Arduino Function: RobotControl.waitContinue

Description

This method pauses the current program and waits for a key pressed from one of the 5 buttons on the control board. When it detects a button pressed, the program continues its function.

Syntax

Robot.waitContinue()
Robot.waitContinue(key)

Parameters

The parameter key represents the momentary switch to listen for. The default value is BUTTON_MIDDLE. Here's a list of possible values: *BUTTON_LEFT *BUTTON_RIGHT *BUTTON_MIDDLE *BUTTON_UP *BUTTON_DOWN

Note

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

Examples

#include 

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);
}


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc