need a programmer for a very basic program
apache
Posts: 7
i am need of a programmer who can write a code that can receive data from a ultrasonic sensor and control a servo motor details will be given to the programmer. please contact me from gidiyorss@gmail.com
Comments
Purchase a BS2 with BOE, a 'ping' sensor package, and a servo from Parallax.
The program will be something like:
ServoPos VAR WORD
PingDistance VAR WORD
MAIN:
GOSUB FindDistance
GOSUB SetServo
GOSUB RefreshServo
PAUSE 20
GOTO MAIN
FindDistance:
' Do stuff here to activate the ping, use PULSIN to get the response,
' do some simple math to convert pulse-width to distance
RETURN
SetServo:
' Do stuff to adjust ServoPos so the servo does what you want it to.
RETURN
RefreshServo:
PULSOUT ServoPin, ServoPos
RETURN
' The two subroutines I've commented above probably will be less than 10 lines each.
' As you can see, this should be extremely simple.