tinyBotSlowWave
tinyBotSlowWave
This program is Text Only. There is no mimicBlock version of this program.
tinyBotSlowWave 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, by changing the delay time between movement steps. Normally, tinyBot moves one step every 20 milliseconds. By INCREASING this number we SLOW tinyBot. By DECREASING this number we SPEED UP tinyBot.
Commands used:
robotMove(<channel>,<position>,<speed>)
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. Because this program moves through every movement step, we don't need a delay between commands.
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?
Download Files:
Don't feel like copying the files? Download the complete program here.
Download tinyBotSlowWave.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,40); //this means 40 millisoconds between steps instead of 20
robotMove(3,80,40); //it doesn't seem like much, but you'll wave at half the speed!
}