Servo!!!



start:
pulseWidth var byte ' set up constants with the minimum and maximum pulsewidths minPulse CON 50
maxPulse CON 250 ' set up a constant with the time between pulses:
refreshPeriod CON 20 ' set an initial pulsewidth:
pulseWidth = minPulse
main: 'take the output pin low so we can pulse it high
Low PORTb.2 ' pulse the pin
PulsOut PORTb.2, pulseWidth ' pause for as long as needed:
Pause refreshPeriod ' change the angle for the next time around:
IF pulseWidth > maxPulse Then
pulseWidth = minPulse
Else
pulseWidth = pulseWidth + 1
Endif
GoTo main

1 Comments:
Blog with the Best
Ever wonder what African American scholars are thinking? Sure, when a fresh controversy makes headlines or a new study shocks us with worrying statistics, a black professor will appear on TV or be quoted in ...
Find out how you can buy and sell anything, like things related to private road construction on interest free credit and pay back whenever you want! Exchange FREE ads on any topic, like private road construction!
Post a Comment
<< Home