Shop OBEX P1 Docs P2 Docs Learn Events
need help comparing this varible — Parallax Forums

need help comparing this varible

skynuggetskynugget Posts: 172
edited 2008-06-14 02:53 in BASIC Stamp
hi all i have this battery charge monitor that i can communicate via serial and i am having trouble with a signed varible

the charger gives me me 16bit numbers in 8bit form strings so i get grab them like this

SERIN TXD, sbaud, 2000, NoGo, [noparse][[/noparse]Amps.HIGHBYTE,Amps.LOWBYTE]

now amps = a value from -32768-32767 in twos compliment

ie -200 = 65336

my question is how can i make the stamp realize this is a signed varible so that i can compare it like

if amps > -200 then go

thanks in advance!

Comments

Sign In or Register to comment.