strongdrink
Junior Member level 2
Hello all,
I am fooling around with the ATTiny13 inputs. My circuit basically consists of an LED attached to PB3, and a button+resistor coming from VCC to PB1.
My code uses "bit_is_clear(PINB, PB1);" to basically turn the LED on/off depending on the state on PB1.
Here is the problem.. when I have the resistor in (without the button being pushed) the LED goes high. If I take the resistor out, it goes low. This is where it gets weird... if I put ONE end of the resistor attached to PB1, and leave the other end sticking up in the air, the LED goes high.
Thanks for any help
I am fooling around with the ATTiny13 inputs. My circuit basically consists of an LED attached to PB3, and a button+resistor coming from VCC to PB1.
My code uses "bit_is_clear(PINB, PB1);" to basically turn the LED on/off depending on the state on PB1.
Here is the problem.. when I have the resistor in (without the button being pushed) the LED goes high. If I take the resistor out, it goes low. This is where it gets weird... if I put ONE end of the resistor attached to PB1, and leave the other end sticking up in the air, the LED goes high.
Thanks for any help