PWM Accelo code?
hello im making a balancing robot using a 16f877 pic microcontroller. but uses the parallax 6 pin accelerometer. i dont no how to interface the two. so the pic reads the acccelo then turns on a motor to keep the robot upright.
thing is i am using PIC code ie Mplab
Can anyone help me>?
Post Edited (blondegod) : 3/15/2008 11:11:35 PM GMT
thing is i am using PIC code ie Mplab
Can anyone help me>?
Post Edited (blondegod) : 3/15/2008 11:11:35 PM GMT
Comments
You didn't say which accelerometer you're using (dual-axis or tri-axis). The interfaces are completely different. The dual-axis unit puts out variable width pulses on 2 different pins that you have to measure. The tri-axis unit uses an SPI interface that requires 3 I/O pins. You might be able to find other examples for interfacing from a PIC to an SPI interface device on the Microchip website in one of their application notes.