I am very new to coding... I have two questions; I ran the blink sketch and am wondering how to stop it from running? I am also looking to set a timer to turn a servo one full rotation every 45 minutes. Any help would be greatly appreciated. I am using an UNO board.
HI Spidey,
welcome to the forum. This is a quite good first post. Shows some own engagement and has a concrete question.
The loop()-function does run infinitely because that is the purpose of function loop().
If you want to run some code only for one time or for 10, 100 or x times you would write the commands inside the setup-function.
For a single run the commands would just be written in the setup-function
For let's say 100 times a for-loop would be used which repeats commands the number of times you programmed.
If you would like to stop the blinking if some condition is true you would code for this
examples: a switch is turned ON or OFF, a certain period of time is over etc.
Of course you can ask here in the forum. But then you have to wait for the answers.
Take a look into this tutorial:
It is easy to understand and has a good mixture between explaining important concepts and example-codes to get you going. So give it a try and report your opinion about this tutorial
best regards Stefan
And for the second part of your question...hardly any servos will turn a full rotation under control Most are limited to around 180 degrees. Do you have a servo in mind that will do what you need?
BTW when you say "every 45 minutes" do you mean it takes 45 minutes to do one rotation or it does a quick rotation then stays stationary for 45 minutes. They're very different.
Steve
Might i suggest you install the Simple Timer library and have a look at their examples. It does exactly what you are wanting