Stop_Button Statement

Reads the value of the stop button. The start button is a digital sensor that returns 1 when being pressed and 0 when not being pressed.

Syntax

  1. stop_button();

Example

  1. /*Wait until the start button is pressed.
  2. Then, print out the analog sensor value until
  3. the stop button is pressed.*/
  4. void main()
  5. {
    1. printf("\nPress start to begin.");
    2. while(start_button()!=1)
      1. sleep(0.5);
    3. while(!stop_button())
    4. {
      1. printf("\nAnalog Value=%d",analog(3));
      1. sleep(0.4);
    5. }
    6. ao();
  6. }