Help Needed: Controlling a motor using ultrasonic sensor and IR sensor

Thread Starter

RobotHeart

Joined Feb 21, 2010
30
i tried reading books but i still couldn't quite understand whats going on with CCP1...i'll keep tryin to understand...but during that time...i want to ask one simple question:

is there's a code that orders a specific pin to give a voltage of lets say 3V ?

because i already have the code that converts the PWM input into distance...so i just need to evaluate these distances...that would be much much much easier. its not neccessery to be linear output....i just need the easy way first...if i accomplish it i will go to the next advanced step (CCP)

just like what i said earlier :

input PortA.1 = 0.5V >> evaluate to distance >> output in PortB.1 = 5V
1V >> evaluate to distance >> 3V
1.5V >> evaluate to distance >> 2.5V
2V >> evaluate to distance >> 1V
2.5V >> evaluate to distance >> 0.5V
3V >> evaluate to distance >> 0V

is it an equation...or a code... ?
please help me on that....please
 
Top