Servo Twitches Continuously After Program Ends
Padawan
Posts: 3
Hi all,
I just recently got the 'What's a Microcontroller?' kit -- with the Homework Board -- and I have encountered a problem. After the ServoTest.bs2 code (from Chapter 4) is finished executing, my servo twitches every 3 to four seconds until I rerun the program or disconnect the battery. I have built my circuits and written my code exactly as depicted in the book. Is there something that I missed that might explain the servo's strange behavior? Any help would be appreciated.
Thanks
I just recently got the 'What's a Microcontroller?' kit -- with the Homework Board -- and I have encountered a problem. After the ServoTest.bs2 code (from Chapter 4) is finished executing, my servo twitches every 3 to four seconds until I rerun the program or disconnect the battery. I have built my circuits and written my code exactly as depicted in the book. Is there something that I missed that might explain the servo's strange behavior? Any help would be appreciated.
Thanks
Comments
Solutions:
1) Connect a 4.7K or 10K resistor between the servo control line and ground (Vss) or
2) End your program with a "HangHere: GOTO HangHere"
The first will keep the I/O pin low when it's changed to input mode eliminating the "twitch".
The second will keep the mode from changing to input by avoiding a STOP or END.
Note that there's an implied END at the end of the program so you need something there to prevent this problem.
Since it's asleep...you could claim the twitch to be a design effect mimmicking a dreaming mamal,
(As long as the servo's not running something like ....a paintball gun or a blade/hammer??? )
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
Thanks you.