Updated specific locations to be searchable, take a look at Las Vegas as an example.

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.

1
display.print a countdown value on my OLED
Post Body

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.

Author
Account Strength
70%
Account Age
3 years
Verified Email
Yes
Verified Flair
No
Total Karma
4,938
Link Karma
1,529
Comment Karma
3,344
Profile updated: 4 days ago
Posts updated: 3 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago