Arduino Exit Status 1 - Page 1
Forum section: electronics / beginners

author: Larsson55
author_rank: Regular Contributor
timestamp: March 05, 2025, 01:05:27 am
content: I'm learning Arduino with the Elegoo Super Starter Kit for UNO V1.0.2019.09.17.I do lesson 4 RGB LED and when I run the code I get:Exit Status 1 Compilaton error 'red value doesn't name a type, did you mean "rename"?The attached file in .odt format is the codeSorry, I don't even know if this is the right way to post the codeThanks

author: ataradov
author_rank: Super Contributor
timestamp: March 05, 2025, 01:53:50 am
content: You are defining variables without a type. It should be something like "int redValue=255;"

author: Larsson55
author_rank: Regular Contributor
timestamp: March 05, 2025, 02:12:00 am
content: Many thanks Alex, now it works after I hit "configure and uploadNow the LED change colors etc. but how to stop now the program running?

author: ataradov
author_rank: Super Contributor
timestamp: March 05, 2025, 02:15:02 am
content: Stop what?

author: Larsson55
author_rank: Regular Contributor
timestamp: March 05, 2025, 02:17:03 am
content: The LED is now changing colors as per code, how to stop the code which makes the LED change colors?I unplug re plug the UNO and it still runs the code

author: brucehoult
author_rank: Super Contributor
timestamp: March 05, 2025, 02:43:49 am
content: Quote from: Larsson55 on March 05, 2025, 02:17:03 amUpload a different program that doesn't do that.Embedded programs don't exit. There is nowhere for them to exit to. They run until you turn the electricity off.You could have a timer or an external event such as a button press cause a different main loop to be executed, or set a flag that causes the single main to do something different e.g. skip the LED colour change. But it will still be looping forever.There can be a way to make the CPU go into a low power mode that doesn't run instructions, but that is more advanced topic, and you always have to be prepared for it to wake up again.QuoteThat is usually the desired behaviour for devices with embedded microcontrollers.

author: Larsson55
author_rank: Regular Contributor
timestamp: March 05, 2025, 02:52:28 am
content: Now I understand, thank you

author: Larsson55
author_rank: Regular Contributor
timestamp: March 05, 2025, 05:38:11 am
content: I think I answered too fast, looks like I can't close the code and the LED still changes colorsI select File/Close and closes the LED codeI select File/New and a new Sketch opens but the LED still flashesSo my question to learn is besides that I can remove the wiring and have the LED no working how can you close a sketch so it doesn't see the previous sketch?

author: ataradov
author_rank: Super Contributor
timestamp: March 05, 2025, 06:01:52 am
content: The code in the MCU only changes when you reprogram it. Anything you do in the IDE outside of programming does not matter.The board and IDE do not depend on each other, you don't need to have the board plugged in while you are typing the code. The board only needs to be present for programming. And after that it runs on its own.So, if you really want it to stop flashing, build and program that new empty sketch. It will overwrite the program with the one that does nothing.

author: Larsson55
author_rank: Regular Contributor
timestamp: March 05, 2025, 07:47:05 am
content: Thank you Alex, quite new to Arduino so may things I find strange for now.I did use File/New Sketch which created a new empty sketch but the LED was still flashing like the sketch I had before was still present. Why is that? I would think if the sketch(code?) is not present the LED should be dead.Now I started the next lesson 5 and so I disconnected the parts I had before from the breadboard. Hopefully as I progress I should learn more...

author: ledtester
author_rank: Super Contributor
timestamp: March 05, 2025, 08:13:19 am
content: Quote from: Larsson55 on March 05, 2025, 07:47:05 amIf you didn't upload the new sketch then you haven't changed the stored program in the Arduino.

author: Larsson55
author_rank: Regular Contributor
timestamp: March 05, 2025, 11:04:59 am
content: Thanks ledtester and BTW I'm very happy with the Elegoo Super Starter Kit you suggestedSo I do File/New Sketch and I get an empty kind of sketchThen I do Sketch/UploadThen I close Arduino and re open and the old program is on againI find that very strange, perhaps Arduino stores the programs in a folder where I can go and remove it without been deleted?

author: DashApple
author_rank: Contributor
timestamp: March 05, 2025, 11:28:54 am
content: When you open a sketch and press upload the sketch is compiled and if all complies Okay the program is downloaded into the flash on the Arduino board. This will run as soon as the board comes out of reset.Opening a file in the Arduino IDE has no effect on what's running on the Arduino, not until upload is pressed then the new code is compiled and then overwrites the old sketch and the new one will start running, So the LED flashing sketch you uploaded would be running always until a new sketch is uploaded to replace this.File/New sketch will open a blank sketch with an empty setup and loop, this can be uploaded but as there is nothing within, the Arduino will just sit in the empty loop and do nothing.

author: brucehoult
author_rank: Super Contributor
timestamp: March 05, 2025, 11:53:54 am
content: Quote from: Larsson55 on March 05, 2025, 11:04:59 amArduino stores the program inside the AVR chip on the board.Once you have a program in the Arduino you can unplug it from the computer and take it away and power it from any 5V to I think 12 V electricity source and it runs the program that is now inside it. Perhaps the most convenient is using a USB phone charger with the same cable to plug into the computer, but you can also use a 6V or 9V battery etc.

author: Larsson55
author_rank: Regular Contributor
timestamp: March 05, 2025, 12:03:17 pm
content: Many thanks folks, I understand

author: Larsson55
author_rank: Regular Contributor
timestamp: March 05, 2025, 11:35:29 pm
content: Got stuck again, Lesson 11 DHT11 Temp SensorCan someone give me a hand, the attached code says "dht_nonblocking.h" not available but it is in the directoryThanks

author: Larsson55
author_rank: Regular Contributor
timestamp: March 06, 2025, 09:17:48 am
content: I got the Analog module installed with no error messages. I have the serial Monitor ON. The range of values are 0 to 1024. Moving the joystick where do I see these values?

author: Ian.M
author_rank: Super Contributor
timestamp: March 06, 2025, 12:03:26 pm
content: Please stop posting your code as OpenOffice documents! Arduino .ino files are text files, so there is no need to involve a wordprocessor that may make unwanted changes to your code. Simply make a copy, renaming <whatever>.ino to <whatever>.ino.txt to post it. (Keeping the .ino before the .txt helps us know what it needs renaming back to, but is not essential.) For small code snippets you can also put your code directly in your post using Code tags [] button in the forum editor, but that gets awkward for larger programs and doesn't let us easily compare line numbers with the error messages you are getting.The error suggests you don't have the non-blocking DHT sensor library properly installed. This should be done through the Arduino library manager. Simply copying the files to your sketch folder doesn't work as #include <> doesn't look in the sketch folder. You'd need to replace <> with "" and also probably make similar edits to the .cpp files you copied from the library. This is a PITA and best avoided by a novice so use the *expletive* library manager!

author: Larsson55
author_rank: Regular Contributor
timestamp: March 06, 2025, 02:20:51 pm
content: Apologies Ian for posting code the wrong way, next time I know now better.How do I get the "expletive" library manager?Thank you

author: themadhippy
author_rank: Super Contributor
timestamp: March 06, 2025, 02:25:35 pm
content: https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries/

author: Ian.M
author_rank: Super Contributor
timestamp: March 06, 2025, 02:44:21 pm
content: Or if you are using the new Arduino IDE (rather than the 'classic' v1.8x one), see:https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library/Note that the v1.8x IDE library manager is very slow as it downloads a database of all available libraries every time you open it, and its search runs letter by letter as you type the search term rather than waiting for you to hit enter before searching. Be patient and wait for it to catch up with your input!

author: Larsson55
author_rank: Regular Contributor
timestamp: March 06, 2025, 02:48:57 pm
content: Thank you both for the library links, very informative

author: Ian.M
author_rank: Super Contributor
timestamp: March 06, 2025, 03:21:11 pm
content: You can also install libraries from a zip file, which may be useful if you have the Elegoo CD from your kit. See:https://support.arduino.cc/hc/en-us/articles/5145457742236-Add-libraries-to-Arduino-IDE#zip-library

author: brucehoult
author_rank: Super Contributor
timestamp: March 06, 2025, 10:28:50 pm
content: Quote from: Ian.M on March 06, 2025, 03:21:11 pmAnd a computer with a CD/DVD drive!!!!None of my computers I've used so far this year have one, though some in my storage room will.On Aliexpress I see 512 MB USB flash drives for $0.67 each in qty 50 and that includes laser engraving the image of your choice (text/logo) on them. 1 GB are $0.78. There may be better deals. 128 MB are $0.50www.aliexpress.us/item/1005003907850958.html

author: ahsrabrifat
author_rank: Regular Contributor
timestamp: March 09, 2025, 05:34:17 pm
content: The problem is in the undeclared variables. You wrote// define variablesredValue=255;greenValue=0;blueValue=0;It must beint redValue = 255;int greenValue = 0;int blueValue = 0;You have defined time inside the loop function. Move it to the top of the code.#define delayTime 10 // fading time between colorsHopefully your code will work if you fix these issues. You can also try this code instead:https://projecthub.arduino.cc/semsemharaz/interfacing-rgb-led-with-arduino-b59902If you wanna buy some more Arduino kits in the future, here is a good list to consider:https://www.theengineeringprojects.com/2021/02/7-best-arduino-starter-kits-for-beginners.html

author: Larsson55
author_rank: Regular Contributor
timestamp: March 09, 2025, 10:11:52 pm
content: Many thanks for your time mate, the link for more starter kits is excellent and definitely I will choose 1 or more kits.The problem with the code was that I didn't installed the required libraries correct. After a few tries I got it and never had a problem to complete all 24 lessons afterwards