So today I started to learn Arduino uno. I have an LM35 temperature sensor and I got what I needed from it. Now it's just keep calculating till I plug it off.

I know there is a reset button. When I press it or hold it, it's closing and opening again to do the coding again. I want it to completely stop. Like when I first plug led was flashing to show arduino is connected.

And I know I can just upload another code. But I don't want that.

If it's possible please let me know.

2 Answers 2


Actually, it already did something when you turned it on when you got it: it was blinking a LED. It did not mean it was connected. A microcontroller (or controller) always does something. Although you can consider an empty endless loop as 'nothing'.

And now you overwritten that sketch with your LM35 sketch.

However, you can put the Blink sketch again in your Arduino, and it can be found here:


You don't need to connect the LED, it will use the built in LED.

If you don't want the Arduino to do anything, just switch it off (disconnect the power).


When a microcontroller or a computer is powered on, it always does something. A program on a computer will return and the OS will run again. On a microcontroller there is no OS to return to, so every microcontroller program has an infinite loop.

The void loop() function of the Arduino framework is such an infinite loop. If you want your LM35 temperature code to be only run once, you can put it into the void setup() function, which is run once before going to loop(). When the loop() function is empty, the Arduino will do nothing after it returned from setup().

Otherwise, if you want to put your code into loop() for whatever reason, you can insert an infinite loop whereever you want it:


This loops forever and does nothing. Your temperature code will only be executed on the next reset or power on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.