# Image tracking processing

**URL:** https://discourse.processing.org/t/image-tracking-processing/34864
**Category:** Electronics (Arduino, etc.)
**Created:** [January 27, 2022, 6:10pm UTC](https://discourse.processing.org/t/image-tracking-processing/34864 "2022-01-27T18:10:03Z")
**Posts on this page:** 2
**Page:** 2

<div class="post-metadata">

### Author: ![doni](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@doni](https://discourse.processing.org/u/doni)
#### Post date: [February 1, 2022, 5:45am UTC](https://discourse.processing.org/t/image-tracking-processing/34864/21 "2022-02-01T05:45:17Z")

</div>

hi brother. when i try this code

```auto
          if (temp_angle != this_angle) 
          {
            //write the servo angle to the serial port
           // byte b1;
            b1 = (byte) this_angle;
            longAngle = this_angle;
            port.write(longAngle);            
            temp_angle = this_angle;
            //println(this_angle);
            //println(String.format("%6d %4d", this_angle, b1));
          }

```

the console write an error said  
“The method write(byte[]) in the type Serial is not applicable for the arguments (long)”

and when i write these part

```auto
      if (temp_angle != this_angle) 
          {
            //write the servo angle to the serial port
           // byte b1;
            b1 = (byte) this_angle;
            longAngle = this_angle;
            port.write(this_angle);            
            temp_angle = this_angle;
            println(this_angle);
            //println(String.format("%6d %4d", this_angle, b1));
          }

```

there is no error in processing console but nothing sent to ard

---

<div class="post-metadata">

### Author: ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)
#### Post date: [February 1, 2022, 8:55am UTC](https://discourse.processing.org/t/image-tracking-processing/34864/22 "2022-02-01T08:55:05Z")

</div>

In the first one above, longAngle is presumably declared as a long, and write() does not accept it. Clear enough, and you probably don’t need a long to reprisent the angle (0…359 unless you go around many many times).

The second should work, comment in the println there, to prove that code is executing, look at the RX light on Ard.

[Previous page](https://discourse.processing.org/t/image-tracking-processing/34864.md?page=1)
