Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRC = 0b11111111;
PORTC = 0b00000000;
DDRB = 0b00000000;
PORTB = 0b00011111;
while(1)
{
if ((PINB & (1<<0)) == 0)
{
PORTC = 0b00000101;
_delay_ms(50);
}
else if ((PINB & (1<<1)) == 0)
{
PORTC = 0b00001001;
_delay_ms(50);
PORTC = 0b00000101;
}
else if ((PINB & (1<<2)) == 0)
{
PORTC = 0b00000100;
_delay_ms(20);
PORTC = 0b00000101;
}
else if ((PINB & (1<<3)) == 0)
{
PORTC = 0b00000001;
_delay_ms(20);
PORTC = 0b00000101;
}
else if ((PINB & (1<<4)) == 0)
{
PORTC = 0b00000000;
_delay_ms(50);
}
}
}