Ah, another brilliant demonstration of my utter lostness in the field of electronics!
I managed to strip three wires in less than five minutes—a huge improvement over last week—but I still suck at soldering:
My hands shake a lot, I’ve learned. Also, I can’t see. I had to bring in the nasty fluorescent work light that I use when I’m doing proofreading, and even then I had to get my eyes down so close to what I was soldering that I almost soldered my face. Another thing I’ve learned thus far is that you basically get one chance at making each join. If you mess up on the first try, any attempts to fix it just seem to make matters worse. And smoky.
(I know it doesn’t look very dim, but trust me.)
Swapping in other kinds of variable resistors required my actually thinking, however, and that part didn’t go so well.
I had wanted to get a flex sensor, but the computer store suddenly changed its hours—I guess because we’re three weeks into the semester?—and was closed five minutes before I arrived. So no Hug-O-Meter for me. Instead, I rewired the board with a photocell, a thermistor, and two LEDs, per the other photo, and then changed the code accordingly. Only one of the LEDs was responding, though, and it was the wrong one. Covering the photocell made the green LED dim instead of the red one. So I fiddled with the code a bit, checking the Serial.print output to see if the thermistor was doing anything at all, and eventually I turned around the red LED.
Aaah. I really need to learn which leg of an LED goes where.
So then both LEDs were lit, and the red one was responding to the photocell, but the green one wasn’t doing squat. I fiddled with the code some more, changing
analogWrite(ledB, potValueB/4); to
analogWrite(ledB, potValueB*4);, but that didn’t do anything. So I took out the resistor (a 220) that was adjacent to the thermistor, and the Serial.print numbers shot up and the LED got a lot brighter. So then I swapped in different resistors: 10 was no good, 100 was no good, but 1,000 did the trick: finally, the changes in brightness were visible.
Nice nail polish, huh.
Do I understand why this worked? Absolutely not. But it worked! Woot!