#include <avr/io.h>
+#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <stdio.h>
#include "usart.h"
int main(void)
{
- uint8_t pb = 0x00;
- int8_t dir = 1;
- volatile uint16_t i;
-
DDRB = 0xff;
+ PORTB = 0xff;
usart_init();
+ printf("\n");
+
i2c_init();
+ printf("Waiting for I2C...\n");
+
sei();
- printf("Hallo!\n");
+ PORTB = 0xff;
while(1) {
- pb += dir;
- PORTB = pb;
-
- for (i = 0; i < (pb<<5); i++) {}
-
- if ((pb == 0) || (pb == 0xff))
- dir = -dir;
+#if 1
+ sleep_mode();
+#endif
}
return 0;