Author Topic: Arduino Exit Status 1  (Read 1833 times)

0 Members and 1 Guest are viewing this topic.

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Arduino Exit Status 1
« on: March 05, 2025, 01:05:27 am »
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 code

Sorry, I don't even know if this is the right way to post the code

Thanks
Nicolas
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12009
  • Country: us
    • Personal site
Re: Arduino Exit Status 1
« Reply #1 on: March 05, 2025, 01:53:50 am »
You are defining variables without a type. It should be something like "int redValue=255;"
Alex
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #2 on: March 05, 2025, 02:12:00 am »
Many thanks Alex, now it works after I hit "configure and upload

Now the LED change colors etc. but how to stop now the program running?
Nicolas
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12009
  • Country: us
    • Personal site
Re: Arduino Exit Status 1
« Reply #3 on: March 05, 2025, 02:15:02 am »
Stop what?
Alex
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #4 on: March 05, 2025, 02:17:03 am »
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
Nicolas
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5051
  • Country: nz
Re: Arduino Exit Status 1
« Reply #5 on: March 05, 2025, 02:43:49 am »
The LED is now changing colors as per code, how to stop the code which makes the LED change colors?

Upload 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.

Quote
I unplug re plug the UNO and it still runs the code

That is usually the desired behaviour for devices with embedded microcontrollers.
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #6 on: March 05, 2025, 02:52:28 am »
Now I understand, thank you
Nicolas
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #7 on: March 05, 2025, 05:38:11 am »
I think I answered too fast, looks like I can't close the code and the LED still changes colors

I select File/Close and closes the LED code
I select File/New and a new Sketch opens but the LED still flashes

So 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?
Nicolas
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12009
  • Country: us
    • Personal site
Re: Arduino Exit Status 1
« Reply #8 on: March 05, 2025, 06:01:52 am »
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.
« Last Edit: March 05, 2025, 06:03:48 am by ataradov »
Alex
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #9 on: March 05, 2025, 07:47:05 am »
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...
Nicolas
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3453
  • Country: us
Re: Arduino Exit Status 1
« Reply #10 on: March 05, 2025, 08:13:19 am »

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.


If you didn't upload the new sketch then you haven't changed the stored program in the Arduino.

« Last Edit: March 05, 2025, 08:14:55 am by ledtester »
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #11 on: March 05, 2025, 11:04:59 am »
Thanks ledtester and BTW I'm very happy with the Elegoo Super Starter Kit you suggested

So I do File/New Sketch and I get an empty kind of sketch
Then I do Sketch/Upload
Then I close Arduino and re open and the old program is on again
I find that very strange, perhaps Arduino stores the programs in a folder where I can go and remove it without been deleted?
Nicolas
 

Offline DashApple

  • Newbie
  • Posts: 7
  • Country: gb
  • So Far, So Good
Re: Arduino Exit Status 1
« Reply #12 on: March 05, 2025, 11:28:54 am »
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.
« Last Edit: March 05, 2025, 11:40:14 am by DashApple »
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5051
  • Country: nz
Re: Arduino Exit Status 1
« Reply #13 on: March 05, 2025, 11:53:54 am »
I find that very strange, perhaps Arduino stores the programs in a folder where I can go and remove it without been deleted?

Arduino 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.
« Last Edit: March 05, 2025, 12:22:07 pm by brucehoult »
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #14 on: March 05, 2025, 12:03:17 pm »
Many thanks folks, I understand
Nicolas
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #15 on: March 05, 2025, 11:35:29 pm »
Got stuck again, Lesson 11 DHT11 Temp Sensor

Can someone give me a hand, the attached code says "dht_nonblocking.h" not available but it is in the directory

Thanks
Nicolas
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #16 on: March 06, 2025, 09:17:48 am »
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?
Nicolas
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13368
Re: Arduino Exit Status 1
« Reply #17 on: March 06, 2025, 12:03:26 pm »
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!
« Last Edit: March 06, 2025, 12:05:01 pm by Ian.M »
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #18 on: March 06, 2025, 02:20:51 pm »
Apologies Ian for posting code the wrong way, next time I know now better.

How do I get the "expletive" library manager?

Thank you
Nicolas
 

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 3526
  • Country: gb
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13368
Re: Arduino Exit Status 1
« Reply #20 on: March 06, 2025, 02:44:21 pm »
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!
 

Offline Larsson55Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: ca
Re: Arduino Exit Status 1
« Reply #21 on: March 06, 2025, 02:48:57 pm »
Thank you both for the library links, very informative
Nicolas
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13368
Re: Arduino Exit Status 1
« Reply #22 on: March 06, 2025, 03:21:11 pm »
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
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5051
  • Country: nz
Re: Arduino Exit Status 1
« Reply #23 on: March 06, 2025, 10:28:50 pm »
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

And 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.50

www.aliexpress.us/item/1005003907850958.html


 

Offline ahsrabrifat

  • Regular Contributor
  • *
  • Posts: 101
  • Country: pk
Re: Arduino Exit Status 1
« Reply #24 on: March 09, 2025, 05:34:17 pm »
The problem is in the undeclared variables. You wrote
// define variables
redValue=255;
greenValue=0;
blueValue=0;

It must be
int 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 colors
Hopefully 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-b59902
If 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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf