int led1 = 2;
int led2 = 3;
int led3 = 4;
int poti = A0;
int poti1 = 0;
bool status1 = false;
bool status2 = false;
bool status3 = false;
unsigned long previous1millis = 0;
unsigned long previous2millis = 0;
unsigned long previous3millis = 0;
void setup() {
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(poti, INPUT);
Serial.begin(115200);
}
void loop() {
poti1 = analogRead(poti);
if(millis() - previous1millis > poti1 * 2){
digitalWrite(led1, status1);
digitalWrite(led2, !status1);
status1 = !status1;
previous1millis = millis();
}
Serial.print("Millis: ");
Serial.print(millis());
Serial.print(" , Vorher: ");
Serial.print(previous1millis);
Serial.print(" , Status1 : ");
Serial.print(status1);
Serial.print(" , Status2 : ");
Serial.print(status2);
Serial.print(" , Analog: ");
Serial.print(poti1);
Serial.print(" , Analog x2: ");
Serial.println(poti1 *2);
}