1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-11-14 20:36:03 +01:00
cdf2018-principal/arduino/Arduino-Makefile/examples/BlinkInAVRC/blink.c
Geoffrey Frogeye 935d1054a7 Actionneurs
Partie Robotech hors-projet
2018-05-08 00:45:08 +02:00

39 lines
569 B
C

/*
* (c) Anil Kumar Pugalia, 2010. Email: email@sarika-pugs.com
*
* ATmega48/88/168, ATmega16/32
*
* Example Blink. Toggles all IO pins at 1Hz
*/
#include <avr/io.h>
#include <util/delay.h>
void init_io(void)
{
// 1 = output, 0 = input
DDRB = 0b11111111; // All outputs
DDRC = 0b11111111; // All outputs
DDRD = 0b11111110; // PORTD (RX on PD0). Just for demo
}
int main(void)
{
init_io();
while (1)
{
PORTC = 0xFF;
PORTB = 0xFF;
PORTD = 0xFF;
_delay_ms(500);
PORTC = 0x00;
PORTB = 0x00;
PORTD = 0x00;
_delay_ms(500);
}
return 0;
}