For example, I wanted the buzzer music to come on when the temperature dipped well below room temperature. When trying to figure out the code for the temperature sensor, I spent a lot of time writing things like:
and if(sensorValue <=100)
and if(sensorValue <=50)
By using the Arduino Serial Monitor, I'd determined that the ambient temperature of my room equated to approximately 157 (I don't yet know how that translates to degrees in Fahrenheit). I thought that using the <= sign would tell the LilyPad that I wanted it to trigger the music when the temperature went down. This was NOT the case.
The correct way to achieve the result I was after actually looks like this:
The >= sign doesn't seem to mean GREATER than in this case, because when the temperature goes DOWN, my music comes on. I would like to understand this better.
In any case, when I wear my hat indoors the lights flash, but the music doesn't come on unless the ambient temperature is pretty chilly. The beauty of this is that the music should only come on when I'm outside, away from the delicate nerves of my loved ones (or to signal our need to heave another log onto the family hearth).