It's been a while - still haven't done it, but am getting back into thinking about it.
I was thinking a bit, and I cleared up my 'mission statement' for this.
I want to:
- Measure temperature with a TMP36.
- Dynamically convert the reading from the TMP36 into PWM values.
- Gracefully fade the lighting along with the temperature using the values calculated through blue (B255), yellow (G255 R255), and red (R255).
So, to this end, I've decided I'd use the breakout shield as follows:
- P0 (PWM) -> 100 Ohm Resistor -> Red LED prong
P0 GND -> RGB LED GND prong - P1 (PWM) -> 180 Ohm Resistor -> Green or Blue LED prong
- P2 EMPTY
- P3 EMPTY
- P4 (PWM) -> 180 Ohm Resistor -> Green or Blue LED prong
- P5 -> TMP36 Read prong
P5 GND -> TMP36 GND prong
P5 5V -> TMP36 5V reference voltage prong
Before I go off half-cocked with a hot soldering iron, I just wanted to solicit a sanity check to make sure this is likely to work as intended.
I also would really appreciate any advice on an algorithm or logic to properly scale the TMP36 reading to the PWM values so I can gradually fade from one 'temperature' colour to the next, and proportionally to the heat level. I went to school for law, not math or computer science (though I wanted to), so be gentle and accept my apologies in advance for my ignorance.
Thanks a lot, folks!