Ok so my school has a robotics program. Its not selective. Ive been crying my eyes out the whole night because Idk how to program two leds being progresively turned on by a different potentiometer each, while a third led is turned on by a button. I. NEED. HELP. If you know how to do this PLEASE. HELP. ME. I. CANNOT. FAIL. I admire people that actually subject themselves to this, please help a lost soul like me PLEASE. PLEASE. PLEASE.
Topic moved. Please do not post in "Uncategorised"; see the sticky topics in Uncategorized - Arduino Forum.
Please give a good description of the project. I have no idea what "progressively turned on" means; do you mean that their brightness must change based on the potentiometer setting?
If so, have a look at the 01. Basics → AnalogReadSerial in the IDE to understand how to read your potentiometer.
Next you can study the example 03. Analog → AnalogInOutSerial.
For the button, you can study https://docs.arduino.cc/language-reference/en/functions/digital-io/digitalread/ and https://docs.arduino.cc/language-reference/en/functions/digital-io/digitalwrite/.
BTW, I doubt your school is stupid.
The Arduino IDE has lots of examples, start with the most simple and build on that.
This tutorial may get you started with the less challenging part of the project, that is using an Arduino to read a push button switch and light a led.
Why bury the subject? Have you tried "duckduckgo.com arduino two led two potentiometer"?
"Elective"
Replace that with study all night, and you have the key to success.
Parents, administrators, teachers. All at the end of an e-mail ("vintage" communications method).
Rather condescending.
I can predict your future.
I do not know what that means.
Hello mmm_34567
Give the hardware components names, write a story about when, how and why this hardware interacts, and then start programming.
Avoid using the delay() function as this blocks real-time processing.
In general - Arrays and structs are your friends.
Have a nice day and enjoy coding in C++.
Hi, @mmm_34567
Welcome to the forum.
If you have the project requirements on paper as written from your teacher, can you please post a copy of it here?
Either a photograph of the paper, or an exact transcript of the paper.
We need to know exactly what the project requires.
Then we can guide you.
Tom....
![]()
Does this:
...mean something like the first of these:
Can you make one potentiometer light one led progressively?
If we did the work for you (draw a connection diagram and write the program) and you were asked by your teacher and classmates to explain how it worked, could you?
At the end of the day - you just need to spend time taking small steps
Get acquainted with the very basics of C++ and the IDE
Light a led
Print the value of a potentiometer
Use millis to drive something asynchronously (study blink without delay as a start)
Then For extra information and examples look at
- Using millis() for timing. A beginners guide
- Several things at the same time
- Flashing multiple LEDs at the same time
you might benefit from studying state machines. Here is a small introduction to the topic: Yet another Finite State Machine introduction
Like everything in life, efforts and patience are required. Rome wasn’t built in a day.
Now if you waited till the last minute thinking the forum would solve that for you then bad news….you’ll have to face the music or copy a friend’s work and cross fingers that chatGPT will do it for you…
You could go the ChatGPT way, then you know you won’t be best in the class, and you might squeak through the class, and then go back to geology instead.
You have 11 responses so far.
What have you tried?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.