This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
TL;DR: Want to show remaining time in a countdown on my OLED for this project:
---- The Issue ---
I'd like to print the remaining time (seconds for now) of a variable. I am enabling a relay for a specified period of time. In the serial monitor, I am able to use the below to successfully see a "fanDelayCountdown = 3, fanDelayCountdown = 2," etc...
Serial.print(fanCountDown);
Serial.print(" fanDelayCountDown = ");
^^ works for serial monitor
BUT
I'd like to print the same info to my working OLED screen but find that
display.print("Countdown = ");
display.print(fanCountDown);
does not behave the same way. All I get on the OLED is the int value of zero.
//Setup Fan Distance and Timer
int fanCountDown = 0;
int fanOnSeconds = 0;
The actual fan duration is set in the loop.
//Fan Distance and Duration Variables
fanOnSeconds = 5;
And is later activated under specific conditions
// Turn On Fan and Init Count Down Timer
digitalWrite(fanRelay, HIGH);
//Timer amd CarStatus
fanCountDown = fanOnSeconds;
Ideally, I'd print to OLED "Countdown = X" with X being the remaining seconds in the countdown.
\* to clarify (edit), the OLED displays the fanOnSeconds value of 5 and does not countdown.*
Forgive me if I haven't formatted the code appropriately for the forum. I am a curious noob.
Everything else functions as I'd hope. I have three indicator LEDs that show me my various variables and actions are occurring as expected (based on distance of an object and time it is in range). This is, admittedly, a "nice to have" but would polish up my project.
--- The Project ---
This project uses an ultrasonic sensor to determine if my car is home in the garage or not. When the car arrives and is in proper range, the relay gets activated. The relay enables an exhaust fan (1963 Mercury Meteor is gassy). The car then pulls completely forward and the fan runs for a set amount of time. I have a working version and then... lost the dang code (long story) and am rewriting it and adding a few features.
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/arduino/com...