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

  1. start_button();

Example

  1. /*Wait until the start button is pressed.
  2. Then, move forward until the sonar sensor detects is close to the wall.*/
  3. void main()
  4. {
    1. printf("\nPress start to begin.");
    2. while(start_button()!=1)
      1. sleep(0.5);
    3. motor(2,95);
    4. motor(4,95);
    5. while(sonar()>500)
      1. sleep(0.5);
    6. ao();
  5. }