next up previous contents
Next: 9.2.1 User Buttons and Up: 9.2 Sensor Input Previous: int digital(int p)

int analog(int p)


Returns value of sensor port numbered p. Result is integer between 0 and 255.

If the analog() function is applied to a port that is implemented digitally in hardware, then the value 0 is returned if the digital reading is 0, and the value 255 is returned if the digital reading is 1.

Ports are numbered as marked on the Handy Board.



Fred G. Martin
Fri Mar 29 17:44:15 EST 1996