tinyBotPickAndSet

tinyBotPickAndSet

 

tinyBotPickAndSet moves a block from one place on the ground to another. This experiment requires the user to find just the right position for channel 3 to place the block. It's not as simple as just copying the text this time! Positive numbers close the gripper, negative numbers open it. Like moving servos fast, the robotGrab command requires a delay.

Commands used:

robotMove(<channel>,<position>)

robotGrab(<force>)

delay(<time>)

What We Learn:

Sometimes we need to tune our robots to their environment. In this experiment each robot may have a slightly different channel 3 position to release the block, depending on robot setup and the surface it's sitting on.

Instructions:

Download the program images HERE or click the images below. The file includes both the mimicBlock and Arduino versions of the tinyBotPickAndASet 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?

Click to View Full Size

Download Files:

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

Download tinyBotPickAndSet.ino for Arduino

Download tinyBotPickAndSet.adp for mimicBlock

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
  //Move to the block and pick it up
  robotMove(1,50);
  robotMove(2,75);
 
 
  //This next step is incomplete. You need to add your channel three position
  robotMove(3, ???); //<-- PUT YOUR CHANNEL 3 POSITION HERE

  //grab the block
  robotGrab(100);   //The higher the number, the harder the robot grabs. 127 is the maximum
  delay(2000);  //let's wait 2000 milliseconds (2 seconds) to make sure the robot has a good grip

  //Move robot to HOME position
  robotMove(3,127);
  robotMove(2,127);
  robotMove(1,127);

  //Move to the set-down position
  robotMove(1,150);
  robotMove(2,75);
 
  //This next step is incomplete. You need to add your channel three position
  robotMove(3,???);  //<--- PUT YOUR CHANNEL 3 POSITION HERE
  //Good job!
 
  robotGrab(-100);  //the negative number will open the gripper
  delay(1000);
  robotGrab(0);  //we need to turn off the gripper by resting to zero. That keeps it from wearing out.
 
  //Move robot to HOME position
  robotMove(3,127);
  robotMove(2,127);
  robotMove(1,127);
}