Smitty,
Just use the "new code" in the last post by itself (I did the moving for you).You said "Look at the code in the Interrupt Handler. Put this in your main loop"
Did you mean to compile just the code you listed or to add it to one of the others? If you meant by itself then it compiled just fine.
Add something like this just below the variable declarations to give an initial starting value.It starts with Rot1:00 and Rot2:35
RotEnc1_val = 0
RotEnc2_val = 0
OK. Do you have the datasheet for the encoders? I assumed (always bad) that they where mechanical encoders, similar to the one shown here. Hook-up as per the nice diagram.
If they are not mechanical encoders, then they are optical. If so, they will have a Vcc, GND, ChA, and ChB. Also, no pull-ups (or downs) required.
At least it looks like the code is working. More info please.
Steve
Bookmarks