Multiple questions on beginner sketch and updates

I'm revisiting each of the first 10 lessons for my Elegoo Fun Kit and coming up with some questions.

  1. .What does the term "void" do in the initial setup? it seems that simply would cancel/void/undo the setup.

  2. I've received a prompt to update my Uno R3, but in reading the update it seemed to apply to everything but my R3. Now I'm wondering if I made a mistake and if so, how to reinitiate the update.

  3. I loaded a default sketch for Lesson 4 RGB LED and despite not saving it did and overwriting it. I've deleted the overwritten file and want it back. What's the best way to reload it. These lessons are Elegoo, but look / read like Arduino kit lessons but don't necessarily track one to one.

  4. How do I properly drop code in for asking questions.

A link to where we can see that or the actual code where you struggle would help us help you…

1 Like

in Arduino system a function of type void gives no value back.
sometimes you will see someone writing void setup(void){}

what kind of? a SMS? was there download link? never trust such SMS and never download anything from prompted links. Read internet how to check if your computer is infected with a virus

do you mean example sketch? example sketches are protected from rewriting, if you save something you save a copy to sketchbook. in the IDE is an option "save before upload".

don't drop anything, use trash can. wait, do you mean "how should I using forum tool to insert code pieces in my messages?" ah, well, use "code tag" button: marking entire sketch, click "copy", press "code tag", click paste. from IDE you able to copy as "copy for forum", then just paste, it will contain own tags.

1 Like
1 Like

I’m not sure how link will help; it goes straight to download. The tutorial is in .pdf I could upload that for reference.

It appears I did overwrite the example sketch but I found a copy and pasted it back. I moved the folders in which the files were embedded. Did I bypass the protections against overwriting by doing so?

The prompt appeared legitimate, I’m pretty good at recognizing phish attempts. I’ll screenshot the message next time and post it.

Mine is the Elegoo Upgraded Electronics Fun Kit.

That interprets return null, set it up, return null 0+setup+0=setup? Kinda?

I know. That's why I posted it.

Strike three.

wrong. null(0x00) is the result, no result at all is void

i can not understand this.

sketch is a program.
program is a list of instruction for processor.
processor take one instruction from memory, do it, take next, and again, until the end. old computers staying and waiting the new input of program or restart the existing. now computers starting over automatically. user(programmer) usually want do some operation before program starts forever(IRL it is not possible).
every program is basically:

int main()
{
  some staff that handles only once(after start) (ArduinoIDE place here entire 'setup()')
  while(true)
  {
    program runs again and again (ArduinoIDE place here entire 'loop()')
  }
}

I’m replying to kolaha in case he missed it. Threads can get busy depending on level of detail. What does strike 3 mean anyway? Seems hostile.

As one person’s reply said, this is a computer. It does exactly what it is told. If I want to do a setup, why is that command preceded with the command void? If this just reinforces to the coder that no return is expected it would be structured as a comment. So, there is a background program running that is reading our code needs to be instructed that no return is expected so a fault doesn’t occur?
It’s like me saying to you “Don’t say anything , do you job”. :upside_down_face:

C++ is compiled into binary it's not interpreted.

In C++, the keyword "void" in front of a function indicates that this function does not return any value. that helps the compiler verify things out and organise the function call.

1 Like

Best answer and no condescension! I appreciate both!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.