]> git.zerfleddert.de Git - rsbs2/blob - bmc/bmc.c
c786032e092d235dec4240be704dae4eda4c34b6
[rsbs2] / bmc / bmc.c
1 #include <avr/io.h>
2 #include <avr/interrupt.h>
3 #include <stdio.h>
4 #include "usart.h"
5 #include "i2c.h"
6
7 int main(void)
8 {
9 uint8_t pb = 0x00;
10 int8_t dir = 1;
11 volatile uint16_t i;
12
13 DDRB = 0xff;
14
15 usart_init();
16 i2c_init();
17
18 sei();
19
20 printf("Hallo!\n");
21
22 while(1) {
23 pb += dir;
24 PORTB = pb;
25
26 for (i = 0; i < (pb<<5); i++) {}
27
28 if ((pb == 0) || (pb == 0xff))
29 dir = -dir;
30 }
31
32 return 0;
33 }
Impressum, Datenschutz