]> cvs.zerfleddert.de Git - rsbs2/blame - bmc/bmc.c
beginning i2c
[rsbs2] / bmc / bmc.c
CommitLineData
d6f38d0d 1#include <avr/io.h>
99e4226b 2#include <avr/interrupt.h>
d6f38d0d
MG
3#include <stdio.h>
4#include "usart.h"
99e4226b 5#include "i2c.h"
d6f38d0d
MG
6
7int 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();
99e4226b
MG
16 i2c_init();
17
18 sei();
d6f38d0d
MG
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