byte zaehler = 0;
byte ergebnis = 0;
void setup() {
// put your setup code here, to run once:
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int poti = analogRead(A5);
zaehler = map(poti, 0, 1023, 0, 15);
byte bit0 = zaehler & 0x01;
if (bit0 == 0x01)
{digitalWrite(8, HIGH);}
else
{digitalWrite(8, LOW);}
byte bit1 = zaehler & 0x02;
if (bit1 == 0x02)
{digitalWrite(9, HIGH);}
else
{digitalWrite(9, LOW);}
byte bit2 = zaehler & 0x04;
if (bit2 == 0x04)
{digitalWrite(10, HIGH);}
else
{digitalWrite(10, LOW);}
byte bit3 = zaehler & 0x08;
if (bit3 == 0x08)
{digitalWrite(11, HIGH);}
else
{digitalWrite(11, LOW);}
delay(1000);
}