From 09a249bb66d40a0e2e52727c742273914ba44231 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 23 Aug 2013 21:56:26 +0200 Subject: [PATCH] Tenar: Swapped pins --- tenar/tenar.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tenar/tenar.c b/tenar/tenar.c index d69c0ad..3b9d1c2 100644 --- a/tenar/tenar.c +++ b/tenar/tenar.c @@ -9,8 +9,8 @@ * * +-------------------+ * | RESET* VCC | - * output RESET* | PB3 SCK | - * diagnostic LED* | PB4 MISO | + * diagnostic LED* | PB3 SCK | + * output RESET* | PB4 MISO | * | GND MOSI | * +-------------------+ */ @@ -35,21 +35,21 @@ static void sleep(uint16_t millisec) int main(void) { - PORTB &= ~B(PB3); // PB3: tri-stated - DDRB |= B(PB4); // PB4: output + PORTB &= ~B(PB4); // PB4: tri-stated + DDRB |= B(PB3); // PB3: output for (byte i=0; i<5; i++) { - PORTB &= ~B(PB4); + PORTB &= ~B(PB3); sleep(100); - PORTB |= B(PB4); + PORTB |= B(PB3); sleep(900); } - PORTB &= ~B(PB4); - DDRB |= B(PB3); // PB3: output 0 + PORTB &= ~B(PB3); + DDRB |= B(PB4); // PB4: output 0 sleep(300); - DDRB &= ~B(PB3); // PB3: tri-state - PORTB |= B(PB4); + DDRB &= ~B(PB4); // PB4: tri-state + DDRB &= ~B(PB3); // PB3: tri-state to save power for (;;) { set_sleep_mode(SLEEP_MODE_PWR_DOWN); -- 2.39.2