diff --git a/button_contact.c b/button_contact.c index 9468796bc0e71a8cfe4b1437620123b7e5c51c95..328eefe03bca2d1043664804adfcd5ce741169f7 100644 --- a/button_contact.c +++ b/button_contact.c @@ -7,13 +7,12 @@ int main(void) { // Configure led_pin as an output. DDRB |= led_pin; - // Configure button_pin as an output. + // Configure button_pin as an input. DDRA &= ~button_pin; // Activate button_pin's pullup resistor. PORTA |= button_pin; - // Nothing left to do, so just spin. while (1) { // Turn on the LED when the button is pressed. if (PINA & button_pin) { diff --git a/button_toggle.c b/button_toggle.c index dd98d79052aaeb70b1cdc8dcf12abbdf3ddb98ee..e13dddd5ed7fd57538ef0a3cf4a4cb01d40213b9 100644 --- a/button_toggle.c +++ b/button_toggle.c @@ -23,7 +23,6 @@ int main(void) { int bouncy_switch_state = 0; int debounced_switch_state = 0; - // Nothing left to do, so just spin. while (1) { // Use the timer to count how long it's been since button_pin changed state. if ((PINA & button_pin) != bouncy_switch_state) {