|
Interrupts and rotation sensors
I want to be able to make dead reckoning code based on almost the exact position of the robot. To do this I need rotation sensors for at least one of the wheels, and I need to be able to use interrupts in the code. I'm out of my depth with the interrupt code - All I want to do is to increment a rotation count whenever I receive certain values from an analog input rotation sensor (for example, “the input”%16). I’ve looked over the heavily commented example code but I am still not sure what I need to change to make it work for one specific input. I also need a rotation sensor with which to use this code, and I have no idea where to get it. There has to be some sort of potentiometer or something that functions like the Lego rotation sensors (i.e., it can keep on turning indefinitely), but I have no idea what it would be called or where I can get it.
If anyone can help me out on either of these issues I would really appreciate it. Simply put, I need some tips on using interrupts, and I also need information on where to get rotation sensors.
|