First of all, let me say thanks… I’ve gotten so many tips and libraries from reading these forums. You all are amazing.
I’m trying to build a Nest-like thermostat with my core. I’ve gotten pretty far; (farther than their example, at least), but I’m struggling with the potentiometer as a reliable / good way to read rotation. Plus, like a real Nest, I’d like the wheel to be continuously variable with a nice smooth feel and software-read rotational position. Sounds like a job for a rotary encoder… right?
Most of the ones on the typical stores are junky and a real, sweet optical rotary encoder is like 30$ on digikey.
Luckily, any old PS2 ball mouse or newer optical with a scroll wheel has a pretty high-res rotary encoder in it!! I took apart an old logitech ball mouse and found the X and Y sensors are just slotted plastic wheels in between an IR LED and a detector. I didn’t want to desolder those components and re-write it in Spark because the PS2 controller already does a nice job of decoding the LEDs and reporting a position… so I just need a PS2 interface for my spark.
I found these two libraries for Arduino, but alas, I have no experience in porting them for Spark. Could someone tell me what I need to do to get started down that path, and which library of the two is better?
Here they are:
Any advice appreciated!