Confusion about using the servo
ilford_cannondale
Posts: 3
Hi all-
Okay, I apologize if this is a really stupid question, but I've been reading the book and I can't find out why this is happening:
I am going through the "What's a Microcontroller?" book with my Board of Education Rev C system and the standard Basic stamp (I bought everything as a single product...don't remember what the product itself is called). It came with the Parallax servo and I'm in chapter 4 (Controlling Motion) and the book tells me to, on page 115, enter a program that turns the servo on 3 times in different directions for different times. This works fine. Every time.
As I've been going along, I've been tweaking the programs here and there for experimental purposes (hey, that's what the thing is for, right? ) so on a lark I simply cut out the part that spins the servo the longest and put it in its own file:
When I run it on the stamp, it runs the first time, but subsequent runs do nothing. I have an LED attached per the instructions for the other program and it lights up, but the servo never turns. I run the original program and it works perfectly. I go back to my program and it doesn't do anything (short of turning on the LED).
Clearly I'm missing something here, and I can't seem to find in the book where it's obvious what I'm doing wrong. I've studied pages 116 and 117 over and over and it still seems to me that I should be able to spin the servo again and again with the program above, yet obviously this isn't the case.
Can anyone explain to me what I'm doing wrong so that I can finally "get" how to use the servo properly?
Okay, I apologize if this is a really stupid question, but I've been reading the book and I can't find out why this is happening:
I am going through the "What's a Microcontroller?" book with my Board of Education Rev C system and the standard Basic stamp (I bought everything as a single product...don't remember what the product itself is called). It came with the Parallax servo and I'm in chapter 4 (Controlling Motion) and the book tells me to, on page 115, enter a program that turns the servo on 3 times in different directions for different times. This works fine. Every time.
As I've been going along, I've been tweaking the programs here and there for experimental purposes (hey, that's what the thing is for, right? ) so on a lark I simply cut out the part that spins the servo the longest and put it in its own file:
' {$STAMP BS2} ' {$PBASIC 2.5} counter VAR Word FOR counter = 1 TO 150 PULSOUT 14, 500 PAUSE 20 NEXT
When I run it on the stamp, it runs the first time, but subsequent runs do nothing. I have an LED attached per the instructions for the other program and it lights up, but the servo never turns. I run the original program and it works perfectly. I go back to my program and it doesn't do anything (short of turning on the LED).
Clearly I'm missing something here, and I can't seem to find in the book where it's obvious what I'm doing wrong. I've studied pages 116 and 117 over and over and it still seems to me that I should be able to spin the servo again and again with the program above, yet obviously this isn't the case.
Can anyone explain to me what I'm doing wrong so that I can finally "get" how to use the servo properly?
Comments
if you turn it after the program stops and run it again, it should turn again..
to have it move to a different point.. change the 500 number.
thats how you get it to move.
Do I have that right? If so, is it that I confused the servo with something like a stepper motor in my thinking of how long to have the thing on?
Thanks a lot for the reply,
Ilford
·
Thanks a lot, now it's all clear to me and I can keep going with a little more understanding!
its in the completed projects forum [noparse]:)[/noparse]