|
Interrupts
Could anyone help us with Interrupt Code for use with optical encoders? We are placing two of the small, yellow banner sensors next to the wheel, which will be covered in a sheet of paper with alternating black and white stripes. As the wheel turns we plan on detecting the change between black and white, and by comparing the counts for both the left and right wheels, we should be able to program precise turns and straight lines.
I am aware of some of the problems with Interrupts, therefore I only want to increment a counter when the state changes. The Optical sensors are plugged into rc_dig_in03 and 04.
Anyone have any ideas.
|