Reference   Language | Libraries | Comparison | Changes

Robot

pauseMode()

Description

Pause or resume the mode-specific action for the bottom board.

For line-following mode, the robot will stop following the line, but still receiving commands.

Syntax

Robot.pauseMode(onOff)

Parameters

onOff: boolean. true pauses the mode, false resumes it.

Returns

none

Examples

#include <ArduinoRobot.h>
long timer;

void setup(){
  Robot.begin();
  Robot.beginLCD();
  delay(3000);

  Robot.setMode(MODE_LINE_FOLLOW);
  timer=millis();
  while(!Robot.isActionDone()){
    //pauses line-following for 3 seconds every 5 seconds
    if(millis()-timer>=5000){
      Robot.pauseMode(true);
      delay(3000);
      Robot.pauseMode(false);
      timer=millis();
    }
    Robot.debugPrint(millis());
  }
  Robot.text("Done!",0,10,true);
  while(true);

}
void loop(){
}

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.

Share