Start_Button Statement
Reads the value of the start button. The start button is a digital sensor that returns 1 when being pressed and 0 when not being pressed.
Syntax
- start_button();
Example
- /*Wait until the start button is pressed.
- Then, move forward until the sonar sensor detects is close to the wall.*/
- void main()
- {
- printf("\nPress start to begin.");
- while(start_button()!=1)
- sleep(0.5);
- motor(2,95);
- motor(4,95);
- while(sonar()>500)
- sleep(0.5);
- ao();
- }