Digital Statement
Reads the value of a specified digital port. The value returned will be either a 1 or 0 depending on the state of the digital sensor.
Syntax
- digital('digital port');
Example
- //Move forward until the digital sensor detects a wall.
- void main()
- {
- motor(2,95);
- motor(4,95);
- while(!digital(8))
- sleep(0.5);
- ao();
- }