Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot Duration Issue — Parallax Forums

Boe-Bot Duration Issue

RiphRaphRiphRaph Posts: 5
edited 2010-07-06 01:07 in Robotics
Hello all!

I'm new to this forum and hope you can help.· I assembled and tested my new Boe-Bot today!· I'm going through the testing and tuning procedures now.· I have found that when I try to make the Boe-Bot move forward for greater than 6 seconds, it does not stop after the programmed duration.

For instance, when I use:

For counter = 1 to 122, it runs for 3 seconds
For counter = 1 to 244, it runs for 6 seconds
For counter = 1 to 366, instead of running for 9 seconds, it runs indefinitely.

Any suggestions?




·

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-07-05 21:43
    If counter is a byte, it's maximum value is 255. So in your loop, it will go 1, 2, 3, ..., 254, 255, 0, 1, 2, ... -- never reaching 366. Change counter to a word, and your loop will work the way you want it to.

    -Phil
  • RiphRaphRiphRaph Posts: 5
    edited 2010-07-06 01:07
    Phil,

    Thanks! You were correct! I need to be more careful coding, I see.
Sign In or Register to comment.