paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] Tracking antenna


From: Todd Sandercock
Subject: Re: [Paparazzi-devel] Tracking antenna
Date: Wed, 28 Oct 2009 04:08:40 -0700 (PDT)

Hi marcus

I am not a programmer at all but my knowledge of signed stuff was that 0x00 is 0 and 0x80 was -128. So for a byte or char it basically starts at 0 (0x00) counts up to 127 (0x7F) then at 0x80 it becomes -128 and all bytes above that count down to -1 which is 0xFF.
once again i not a programmer and the day i made that tracker software was basically the day i learnt some java

also the function i was using to write was more like "outputStream.write(int)"

Todd


From: "address@hidden" <address@hidden>
To: address@hidden
Sent: Wed, 28 October, 2009 8:44:36 PM
Subject: Re: [Paparazzi-devel] Tracking antenna

On Tue, 27 Oct 2009 16:41:23 -0700 (PDT), Todd Sandercock
> The big issue with the java api was trying to send the "0x00". you think
> its sent it properly but nothing worked with the servo controller. so i
> plugged 2 ftdi cables into each other and worked out that every time that
i
> sent a "0x00" it turned everything after it to garbage. If you have a fix
> that would be great!

You DO know that 0x00 is a signed integer?
Byte.MIN_VALUE in Java is -128 . That would be your unsigned 0x00 .

> The other thing with java is that there is no such unsigned variables. so
> when you are trying to send anything higher than 127 you have to use an
> int. DUMB!

Actually you do something like send((byte)((value + Byte.MIN_VALUE) &
0xFF))

Marcus


_______________________________________________
Paparazzi-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel


Get more done like never before with Yahoo!7 Mail. Learn more.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]