Analog Statement
Reads the value of a specified analog port. The value returned will be between 0 and 255 depending on the state of the analog sensor.
Syntax
- analog('analog port');
Example
- //Follow a circle created with a black line.
- void main()
- {
- motor(2,95);
- motor(4,95);
- while(1)
- {
- if(analog(3)<150)
- motor(2,15);
- else
- motor(2,95);
- }
- }