int sez[9] = {0b11111111,
0b11111110,
0b11111101,
0b11111011,
0b11110111,
0b11101111,
0b11011111,
0b10111111,
0b01111111
};
void setup() {
DDRD = 0b11111111;
}
void loop() {
int potValue = analogRead(A0);
int mapValue = map(potValue,0,1023,0,8);
int izpis = sez[mapValue];
PORTD = izpis;
}
/*
void loop() {
int izpis;
int potValue = analogRead(A0);
int mapValue = map(potValue,0,1023,0,7);
if(mapValue == 0){
izpis = 0xff;
}else{
izpis = ~(1 << mapValue);
}
PORTD = izpis;
}*/