cosin-badge-tht/main.c

42 lines
808 B
C
Raw Permalink Normal View History

2020-12-02 12:25:32 +01:00
/**
* Copyright CCC Basel 2020.
*
* This documentation describes Open Hardware and is licensed under the
* CERN OHL v. 1.2.
*
* You may redistribute and modify this documentation under the terms of the
* CERN OHL v.1.2. (http://ohwr.org/cernohl).
*
* This documentation is distributed
* WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING OF MERCHANTABILITY,
* SATISFACTORY QUALITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Please see the CERN OHL v.1.2 for applicable conditions.
*/
#include <stdint.h>
#include <avr/io.h>
#include <util/delay.h>
void init() {
PORTB = 0;
DDRB = _BV(PB0) | _BV(PB1) | _BV(PB2) | _BV(PB3) | _BV(PB4);
}
void loop() {
for (uint8_t i = 0; i < 5; i++) {
PORTB = _BV(i);
_delay_ms(500);
}
}
int main() {
init();
while (1) {
loop();
}
return 0;
}