Basic Stamp 2 with Netburner (PINK) SERIN timeout error
Miccim
Posts: 14
Hi there,
I'm using a BOE-bot (rev. C) with BS2 and the PINK (Netburner) module. Using a wall power supply (output 6V DC, 600 mA) to power BOE-bot.
BOE-bot regulates the voltage and powers the PINK (Netburner) according to the manual.
I have made a simple and small webpage to put a "1" or "2" into variable 31 (RAM memory) of PINK (this works fine).
The BS2 must read every 2 or 3 seconds this variable and rotate left servo or right servo. I use these lines of code to do so:
I get lots of time out errors after the servo rotates for the first time, maybe 10 timeout errors or more.
Strange: after these timeout errors the PINK loses it's data/value (variable 31).
When I replace the code to drive the servo and use one or more LEDs instead all works very fine (no time out errors).
What is going wrong here? How to proceed?
Post Edited (Miccim) : 12/7/2009 7:33:48 PM GMT
I'm using a BOE-bot (rev. C) with BS2 and the PINK (Netburner) module. Using a wall power supply (output 6V DC, 600 mA) to power BOE-bot.
BOE-bot regulates the voltage and powers the PINK (Netburner) according to the manual.
I have made a simple and small webpage to put a "1" or "2" into variable 31 (RAM memory) of PINK (this works fine).
The BS2 must read every 2 or 3 seconds this variable and rotate left servo or right servo. I use these lines of code to do so:
' -----[noparse][[/noparse] Main Routine ]----- main: SEROUT TX, Baud, [noparse][[/noparse]"!NB0R31"] ' Send Command To Read Variable 31 SERIN RX, Baud, 100, Timeout, [noparse][[/noparse]UnitCode] ' Get Data With Timeout DEBUG "Code: ", STR UnitCode\1, CR ' Display Byte In Decimal IF UnitCode = "1" THEN GOSUB right_wheel ' Jump to subroutine. IF UnitCode = "2" THEN GOSUB left_wheel ' Jump to subroutine. DEBUG "delay: [noparse][[/noparse] 0," ' Delay 2 seconds and start over again PAUSE 1000 DEBUG "1," PAUSE 1000 DEBUG "2 s] ", CR GOTO main
I get lots of time out errors after the servo rotates for the first time, maybe 10 timeout errors or more.
Strange: after these timeout errors the PINK loses it's data/value (variable 31).
When I replace the code to drive the servo and use one or more LEDs instead all works very fine (no time out errors).
What is going wrong here? How to proceed?
Post Edited (Miccim) : 12/7/2009 7:33:48 PM GMT
bs2
3K
Comments
A 7.5 VDC 1.5 Amp wall-wart would be much better.
Oh, and in your "timeout" routine, you probably shouldn't have a 100 mSec delay -- that would let you miss data.
·
Thanx!
I tried out a big power supply (6V max. 2,5 A) and all works how it should.
The 100 ms for the timeout is no problem (reading only 1 character).
I'm very happy