Shop OBEX P1 Docs P2 Docs Learn Events
Kid needs help with project — Parallax Forums

Kid needs help with project

smith772smith772 Posts: 3
edited 2013-03-10 10:05 in BASIC Stamp
Hi, I am a 9 year old doing a project with my Boe Bot.:cool: I have a Board of Ed kit and have worked through most of the manual. It is really fun.:thumb:

For my special project, I am attaching a pen to my Boe Bot and programming it to write all 26 letters of the alphabet. I am then going to string the letters together into words. I started by trying to get it to write a lowercase "e". My code makes it a bit jerky as it is writing the "e". Does anyone have some suggestions for me on how I can get it to smooth out a bit?

Here is my code:
' {$STAMP BS2} 'This is a lowercase eeeeee
' {$PBASIC 2.5}

counter VAR Word


FOR counter = 1 TO 25

PULSOUT 13, 800
PULSOUT 12, 650
PAUSE 20
NEXT

FOR counter = 1 TO 25

PULSOUT 13, 750
PULSOUT 12, 650
PAUSE 20

NEXT

FOR counter = 1 TO 35

PULSOUT 13, 800
PULSOUT 12, 650
PAUSE 20
NEXT

FOR counter = 1 TO 105

PULSOUT 13, 750
PULSOUT 12, 650
PAUSE 20

NEXT

FOR counter = 1 TO 15

PULSOUT 13, 800
PULSOUT 12, 650
PAUSE 20
NEXT

FOR counter = 1 TO 15

PULSOUT 13, 750
PULSOUT 12, 650
PAUSE 20

NEXT
FOR counter = 1 TO 15

PULSOUT 13, 800
PULSOUT 12, 650
PAUSE 20
NEXT
FOR counter = 1 TO 25

PULSOUT 13, 750
PULSOUT 12, 650
PAUSE 20

NEXT
FOR counter = 1 TO 15

PULSOUT 13, 800
PULSOUT 12, 650
PAUSE 20
NEXT

Comments

  • bomberbomber Posts: 297
    edited 2013-01-31 16:05
    Welcome to the forums, Smith772! Boe bot servo motors are not known for being exact, but you could attatch encoders to the wheels. If you do not have encoders, you can buy them at parallax. I will try this out on my boe later. I am looking forward to hearing about updates on this project; it's really interesting! One tip on your code, you could add a few more variables that could go to a subroutine, so as to save space in the program. For example:
    ' {$STAMP BS2} 'This is a lowercase eeeeee
    ' {$PBASIC 2.5}
    counter VAR Word
    x       VAR Word
    y       VAR Word
    z       VAR Word
    x = 25
    y = 800
    x = 650
     GOSUB motor
    x = 25
    y = 750
    x = 650
     GOSUB motor
    x = 35
    y = 800
    x = 650
     GOSUB motor
    x = 105
    y = 750
    x = 650
     GOSUB motor
    x = 15
    y = 800
    x = 650
     GOSUB motor
    x = 15
    y = 750
    x = 650
     GOSUB motor
    x = 15
    y = 800
    x = 650
     GOSUB motor
    x = 25
    y = 750
    x = 650
     GOSUB motor
    x = 15
    y = 800
    x = 650
     GOSUB motor
    END
    
    Motor:
     FOR counter = 1 TO x
      PULSOUT 13, y
       PULSOUT 12, z
      PAUSE 20
     NEXT
    RETURN
     
    
    This chops about 16 lines off of the code (leaving more space for you to do it multipe times).
  • ercoerco Posts: 20,257
    edited 2013-01-31 18:43
    @smith772: Would love to see some of your "printouts" if you can post some photos. I know firsthand that printing letters takes time & patience. Here's my BS2 printer: http://www.youtube.com/watch?v=5-Z56kPpcM4
  • smith772smith772 Posts: 3
    edited 2013-03-10 10:05
    Hi, yes you were right. I was able to make some good letters, but when I tried it on another day, they looked very different because it seems to change day to day. We bought the digital encoders and have them installed, but are having trouble with the calibration. We ran calibrate_all.bs2 and it gives us zeros mostly in the autocorrelation data. We did get it to download the data once, but it was too inconsistent to calibrate when we put it in the calibrate_all.exe (see picture). How can we get it to calibrate? All I really need is a program to run a square using the encoders, then I could do everything from there. Do I need it to be calibrated? Can you help please?
    callibratezero.PNG
    calibrateall1.PNG
    542 x 497 - 24K
    566 x 686 - 11K
Sign In or Register to comment.