Reference   Language | Libraries | Comparison | Changes

Robot

waitContinue()

Description

Pauses the current program and waits for a key press from one of the 5 momentary buttons. Once you press the key, the program continues.

Syntax

Robot.waitContinue()
Robot.waitContinue(key)

Parameters

key: the momentary switch to listen for. The default value is BUTTON_MIDDLE. Valid choices are

  • BUTTON_LEFT
  • BUTTON_RIGHT
  • BUTTON_MIDDLE
  • BUTTON_UP
  • BUTTON_DOWN

Returns

none

Examples

#include <ArduinoRobot.h>

void setup(){
  Robot.begin();
  Robot.waitContinue();//stop the robot, and wait for the middle button to be pressed
}

void loop(){
  Robot.motorsWrite(255,255);
  delay(2000);
  Robot.motorsWrite(0,0);
  delay(2000);
}

Note

This will not stop sound playing or the millis() function.

See also

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.