Ok, this is weird I have a simple blink sketch that I uploaded to an ATtiny85 with the follow code but instead of the LED being on for 4 seconds and off for 1 second it does the opposite. I am using pin 0 in the code which is IC pin 5 on the tiny. I tried different pins and another chip and still the same results.
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(4000); // wait for 4 seconds
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
And in this code I get the opposite too. If the temp is below 69 the light should be on but it is off and when the temp goes above 69 it should be off but it goes on. This is driving me crazy anyone have any idea why this is?
We know how it's wired - the opposite of how he thinks it is.
The pin is connected to the negative side of the LED, and the positive side is connected to VCC through a resistor. Hence, when the pin goes high, the led turns off, and when the pin goes low, now there's a voltage on the LED, and it turns on. This is a perfectly normal way of wiring up LEDs (people often do this by default, since chips are generally better at driving to ground vs driving to Vcc) - just change your code to drive the pin low when you want the light on, and high when you want it off.