SpoonBot-demo

Version 4 (Anthony Rowe, 06/24/2007 05:08 pm)

1 4 Anthony Rowe
= spoonBot Sample Program =
2 3 Anthony Rowe
3 3 Anthony Rowe
4 3 Anthony Rowe
[[Image(htdocs:images/spoonBot_thumb.jpg)]]
5 3 Anthony Rowe
6 3 Anthony Rowe
spoonBot is a simple differential drive robot with a spoon connected to a servo that allows it to pan and tilt.  See the [wiki:spoonBot spoonBot-Construction] page for information about building spoonBot.  The sample program that comes with the latest cc3 distribution contains sample code demonstrating how to move spoonBot as well as run spoonBot Demo mode.  spoonBot Demo mode is similar to the CMUcam2 demo mode only it uses spoonBot to pan and tilt.
7 3 Anthony Rowe
8 3 Anthony Rowe
Before using spoonBot, you need to calibrate your servo settings.  This is done by setting the following data structure at the top of main:
9 3 Anthony Rowe
{{{
10 3 Anthony Rowe
#!c
11 3 Anthony Rowe
 // SpoonBot Calibration Points
12 3 Anthony Rowe
  //   Assume Left = Servo 0
13 3 Anthony Rowe
  //   Assume Right = Servo 1
14 3 Anthony Rowe
  //   Assume Spoon = Servo 2
15 3 Anthony Rowe
  my_cal.left_mid = 71;
16 3 Anthony Rowe
  my_cal.right_mid = 77;
17 3 Anthony Rowe
  my_cal.spoon_down = 100;
18 3 Anthony Rowe
  my_cal.spoon_mid = 202;
19 3 Anthony Rowe
  my_cal.spoon_up = 255;
20 3 Anthony Rowe
  my_cal.left_dir = 1;
21 3 Anthony Rowe
  my_cal.right_dir = -1;
22 3 Anthony Rowe
  my_cal.spoon_dir = 1;
23 3 Anthony Rowe
  // Set the calibration points
24 3 Anthony Rowe
  spoonBot_calibrate (my_cal);
25 3 Anthony Rowe
}}}