• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Dumbo Newbie Code Help

Status
Not open for further replies.

Traveler

New Member
:confused:
I am constructing this http://www.imagesco.com/articles/picservo/04.html and I just cant seem to get it to compile, I am certainly not a programmer of any sorts I can build valve and transistor projects ( real old school ), I would greatly appreciate one of you experts on this board if possible to compile a hex file of the above link for me :eek: please
or give me a step by step instruction on how to get PICBasic pro to compile it without the syntax and expression errors.
Thank you
 

Traveler

New Member
Ok I will post the code here as requested :

' First servomotor program
' Sweeps left to right, then reverses
INCLUDE "bs1defs.bas"
Symbol B1 = pw ' create a variable pw
pw = 100 ' start at extreme left
sweep: pulsout 0,pw ' send pulse to motor
pause 18 ' set frequency to about 50 Hz
pw = pw + 1 ' increase pw by 1
if pw > 200 then back ' at extreme right, turn CCW
goto sweep ' otherwise, continue
back: pulsout 0,pw ' send pulse to motor
pause 18 ' set frequency to about 50 Hz
pw = pw - 1 ' decrease pw by 1
if pw < 100 then sweep ' at extreme left, turn CW
goto back ' otherwise, continue
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top