#include <Arduino.h>
#include <avr/io.h>
#include <math.h>
void setup() {
DDRD |=(1<<0);
DDRD |=(1<<1);
DDRD |=(1<<2);
DDRD |=(1<<3);
DDRD |=(1<<4);
DDRD |=(1<<5);
DDRD |=(1<<6);
DDRD |=(1<<7);
DDRB &~(1<<0);
DDRB |= (1<<1);
DDRB |= (1<<2);
DDRB |= (1<<3);
DDRB |= (1<<4);
DDRB |= (1<<5);
DDRB |= (1<<6);
PINB |=(1<<0);
}
int main() {
setup();
int i=0;
double array[40]={0x5F,0x6,0x3B,0x2F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};
while (1) {
int s= 0;
PORTB |= (1 << 2);
PORTD=array[i];
_delay_ms(20);
PORTB &=~ (1 << 2);
PORTB |= (1 << 2);
PORTD=array[i];
_delay_ms(20);
PORTB &=~ (1 << 3);
PORTB |= (1 <<3);
_delay_ms(20);
PORTB &=~ (1 << 4);
PORTB |= (1 << 4);
_delay_ms(20);
PORTB &=~ (1 << 5);
for (int i = 0; i < 10; i++) {
// DDRB |=(1<<2);
// DDRB &=~(1<<4);
PORTD = array[i];
// PORTD |= (1 << 7);
_delay_ms(400);
if(i==10){ PORTB|=(1<<3);}
}
return 0; }
}