jigsawkiller
New Member
I'm trying to control a servo using Great Cow Basic (GCBasic). I will be using the PIC18F4520 to control the servo.
So far, I have the following code which I have ported from BASIC Stamp code that does work:
However, the above code only makes the servo turn clockwise in even interval.
Please provide some code that could make a servo work correctly on GCBASIC. Everything compiles correctly, I'm sure the Micro controller and the servo are working. I even tried the code in ISIS simulator and get the same results as in real life.
Thank you...
So far, I have the following code which I have ported from BASIC Stamp code that does work:
Code:
#chip 18f4520, 4
dim Cnt as word
dir PORTB.0 OUT
do
'Counterclockwise:
FOR Cnt = 1 to 20
pulseout PORTB.0, 1000 ms
wait 20 ms
NEXT
'Center:
FOR Cnt = 1 to 20
pulseout PORTB.0, 750 ms
wait 20 ms
NEXT
'Clockwise:
FOR Cnt = 1 to 20
pulseout PORTB.0, 500 ms
wait 20 ms
NEXT
loop
However, the above code only makes the servo turn clockwise in even interval.
Please provide some code that could make a servo work correctly on GCBASIC. Everything compiles correctly, I'm sure the Micro controller and the servo are working. I even tried the code in ISIS simulator and get the same results as in real life.
Thank you...
Last edited: