Ok, I did just use the code by itself and I understand setting the variables to =0. Off to a good start
The encoders are optical with no data sheet since I pulled them out of a ball mouse. There is an emitter, wheel with 36 slots, and reciever for each encoder. They are in the same mounting positions as when the mouse was a mouse. I just chopped off the pc board behind them and attached my wires. The emitters only have 2 pins, +5v and ground. The recievers have 3 pins, A,B, & +5v. I know this because I traced them back on the mouse board before cutting. I also checked another mouse to be sure. (I bought 4 of them to play with).
With my original code (the really simple one a few posts back) nothing happened until I put in the resistors to ground. Thats the only reason they are in the circuit. The read out on the lcd also displayed channel A and B status and I could see 00 01 11 10 00 when rotated very slowly.
I did try your code without the resistors and it didnt make any difference.
I agree with you when you say we need to walk before we run. So I checked the outputs of the encoders with a logic probe. I am getting a high/low pulse out of each of the channels when they are rotated.
Smitty
Bookmarks