Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
491 B
3
Indexable
Never
int k;

void setup() {
Serial.begin(9600);
}

void loop() {
k = 1023 - analogRead(A0);

if (Serial.available () > 0){
  k = Serial.read();
}
//if(k >= 600 && k <= 1023){digitalWrite (13, 0); digitalWrite (12, 0); digitalWrite (11, 1);}
//if(k >= 300 && k <= 599){digitalWrite (13, 0); digitalWrite (12, 1); digitalWrite (11, 0);}
//if(k >= 0 && k <= 299){digitalWrite (13, 1); digitalWrite (12, 0); digitalWrite (11, 0);}
Serial.print("*G");
Serial.print(k);
Serial.print("*");
delay(500);
}