finish script to read out the pottys for insertion in the main programm

This commit is contained in:
Erik Foris 2022-04-10 19:06:45 +02:00
parent 373ea07fff
commit 9c46729c59

View File

@ -2,10 +2,9 @@
void setup() { void setup() {
pinMode(2, INPUT); pinMode(2, INPUT);
pinMode(A4, INPUT); pinMode(A4, INPUT);
pinMode(A2, INPUT);
pinMode(A0, INPUT);
Serial.begin(19200); Serial.begin(19200);
float poty;
float dampness;
} }
@ -13,14 +12,7 @@ void loop() {
Serial.println(digitalRead(2)); Serial.println(digitalRead(2));
delay(200); delay(200);
Serial.println(analogRead(A4)); Serial.println(analogRead(A4));
Serial.println(percentage() ,4); Serial.println(analogRead(A2));
delay(20); Serial.println(analogRead(A0));
delay(1000);
} }
float percentage(){
// float poty = analogRead(A2);
//return poty/454;
return analogRead(A4) / 454;
}