i need to know how to designate an io line to input,, and if im runining this input off of one of the servos wires, will i need to do any thing so the signal sent to activate the servo doesnt fry the chip,,
AND if i used the signal that causes movement in the servo,, will it draw enough curent off the servo to effect its operation,
To set the pin direction (input or output) you can use TRIS or INPUT & OUTPUT statement
TRIS:
=====
TRISB=%11110000 ' Set PORTB<7:4> as input. PORTB<3:0> as output
TRISB.0=1 ' Set PORTB.0 as input
INPUT & OUTPUT :
===============
INPUT PORTB.0 ' Set PORTB.0 as input
OUTPUT PORTB.1 ' Set PORTB.1 as output
IMHO, it's quicker to use TRIS in one shot and place comment on the right edge
If you need to monitor the signal from the motor, be sure the voltage is bellow 5 volt.
You'll need a external chip driver, MOSFETs, Transistor to drive your Motor. PIC can drive/sink a maximum of 25ma.
Welcome to the PICmicro world. Smart move from you guy!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks