tinyBotFastWave

tinyBotFastWave

This program is Text Only. There is no mimicBlock version of this program.

tinyBot making a fast waving motion

tinyBotFastWave uses the same command as earlier experiments, but we add a third term beyond <channel> and <position>. Adding the third term changes the robot's speed, and we'll be using the pre-set speed "fast".

Commands used:

robotMove(<channel>,<position>,<speed>)

delay(<time>)

What We Learn:

Some commands can have optional parameters. We don't NEED to specify the robot's speed, but when we choose to we can change the programs results. We also learn that sometimes the software doesn't know where the robot is, so we insert a delay to make sure the robot reaches the intended position.

Instructions:

Download the program images HERE or click the images below. The file includes both the mimicBlock and Arduino versions of the tinyBotWave program. Copy the program using your computer, then upload it onto tinyBot. Does your robot move like the robot in the GIF at the top of the page?

tinyBotFastWave

Download Files:

Don't feel like copying the files? Download the complete program here.

Download tinyBotFastWave.ino for Arduino

Cut and paste code:

#include <robot.h>

void setup() {
  // put your setup code here, to run once:
  robotActivate();

}

void loop() {
  // put your main code here, to run repeatedly:
  robotMove(3, 170, fast);  //this sends the robot directly to the next position without smoothing motion
  delay(1000);              //we need a delay so there's time for the robot to physically move, so we wait 1000 milliseconds (1 second)
  robotMove(3, 80, fast);   
  delay(1000);
}