Polling

In general there are two ways that you can get data from a sensor:
  • Via Interrupts (when the sensor is directly connected to the computer and sends data unsolicited)
  • By Polling the sensor (sending it a request and waiting for a response)

HiTechnic sensors are connected to the LEGO NXT brick. However, RDS runs on a PC. So a Bluetooth (wireless) connection is used between the PC and the brick. RDS services for the LEGO NXT must therefore send requests to the brick to obtain the current sensor information.

Polling the brick involves a certain amount of latency, or lag, that results from the Bluetooth transmission (to and from the brick) and some overhead on the brick itself. Therefore it is recommended that you do not set the Polling Interval for any sensor to less than 100 milliseconds. Attempting to poll any faster will not necessarily work, and might cause problems with messages backing up.

One disadvantage of a slow polling interval is that you cannot create very fast control loops. If your application requires a rapid response, you might find that the robot tends to overshoot because it is slow to react to changes in the sensor values.

Last edited Jan 24, 2010 at 6:13 AM by TrevorTaylor, version 2

Comments

No comments yet.