From 75c0a2af6ecb8551249c991ec707da391e07882b Mon Sep 17 00:00:00 2001 From: Milad Mohtashamirad Date: Sun, 17 Aug 2025 14:46:56 +1000 Subject: [PATCH] analog value works --- flow_controller.ino | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flow_controller.ino b/flow_controller.ino index 2bc5e1e..e828f52 100644 --- a/flow_controller.ino +++ b/flow_controller.ino @@ -1,3 +1,4 @@ +// Blink LED on pin 13, read analog input from A0, and print to Serial void setup() { pinMode(13, OUTPUT); // Set pin 13 as output @@ -6,10 +7,14 @@ void setup() { void loop() { digitalWrite(13, HIGH); // Turn the LED on - Serial.println("LED ON"); // Print status + int analogValue = analogRead(A0); // Read analog value from A0 + Serial.print("LED ON - Analog Value: "); + Serial.println(analogValue); // Print the analog value delay(1000); // Wait 1 second digitalWrite(13, LOW); // Turn the LED off - Serial.println("LED OFF"); // Print status + analogValue = analogRead(A0); // Read analog again + Serial.print("LED OFF - Analog Value: "); + Serial.println(analogValue); // Print the analog value delay(1000); // Wait 1 second } \ No newline at end of file