by roboTT » Wed Apr 02, 2008 9:45 pm
by roboTT
Wed Apr 02, 2008 9:45 pm
Gerry52 wrote:This is what I found, I'm new to this stuf so please correct me if I'm wrong.
Robobasic doesn't handle negative numbers at all! There is no sign bit. The range of the AD(x) inputs is 0 to 5V, it generates a 0 - 255 value in Robobasic, a byte type can be declared here.
However inputs connected to the 2 axis accelemeter generates a value from 400 to 700 (400 = laying on back side (or left side), 700 = laying on front side (or right side). For this an integer should be declared.
Gerry
You're saying about robobasic, and i'm speaking of reading values with C/C++.
The IR reports positive numbers all the time
The 2Axis reports -127 to +127 evein if being read to Integer.
The values are being read by:
bReadRC = ReadFile(hCom, &rxchar, 1, &iBytesRead, NULL);
into the char rxchar
and are returned mostly as numbers between -127 and 127
Gerry52 wrote:This is what I found, I'm new to this stuf so please correct me if I'm wrong.
Robobasic doesn't handle negative numbers at all! There is no sign bit. The range of the AD(x) inputs is 0 to 5V, it generates a 0 - 255 value in Robobasic, a byte type can be declared here.
However inputs connected to the 2 axis accelemeter generates a value from 400 to 700 (400 = laying on back side (or left side), 700 = laying on front side (or right side). For this an integer should be declared.
Gerry
You're saying about robobasic, and i'm speaking of reading values with C/C++.
The IR reports positive numbers all the time
The 2Axis reports -127 to +127 evein if being read to Integer.
The values are being read by:
bReadRC = ReadFile(hCom, &rxchar, 1, &iBytesRead, NULL);
into the char rxchar
and are returned mostly as numbers between -127 and 127