This commit is contained in:
Sem van der Hoeven
2021-02-10 09:40:47 +01:00
parent 8907ee4669
commit 8a230bd1ee

View File

@@ -7,12 +7,28 @@
#include <avr/io.h>
void wait( int ms )
{
for (int i=0; i<ms; i++)
{
_delay_ms( 1 ); // library function (max 30 ms at 8MHz)
}
}
int main(void)
{
/* Replace with your application code */
DDRD = 0b11111111; // d is output
DDRC = 0b00000000; // c is all input
while (1)
{
if (PINC & 0b00000001) {
PORTD = 0b01000000;
wait(1000);
PORTD = 0b00000000;
wait(1000);
}
}
}