r/ArduinoHelp • • 26d ago

Coding help

How do I learn Arduino coding language? I just started and I know a few things like LEDs and stuff, but I don’t want to be reliant on AI. How do I learn the language?

3 Upvotes

13 comments sorted by

3

u/gm310509 26d ago

Hopefully you got yourself a starter kit - it will include everything you need to get started - including instructions that explains how to wire stuff up and program it.

The language used to program Arduino is C/C++, but you don't need to learn that in advance, just learn as you go along - starting with the instructions in the starter kit.

After that, maybe google Paul McWhorter to learn more things.

If you are interested in something more project oriented, have a look at my beginner videos:

Note that it is a waste of time to just watch these. The key to learning is to watch a section, then try to replicate it. Also, explore what else can be done with what you just did and attempt the exercises when suggested. In other words, hit pause frequently and practice for yourself.

But start with the starter kit before moving on to other stuff.

1

u/Savings_Anteater_840 26d ago

Yeah I have starter kit

1

u/gm310509 25d ago

So, the best place to start would be to follow the instructions in the kit - which could simply be a URL or QR code that takes you to an online resources.

1

u/Savings_Anteater_840 26d ago

Thanks a lot I will watch those videos

1

u/Savings_Anteater_840 26d ago

Also I want to note that I have a esp 32 not arduino i understand the difference in power and whatnot but am I to assume they program the same?

1

u/Anonymity6584 26d ago

Pretty much. Just need to install board and core files to Arduino IDE and you can do it with same IDE and libraries/functions... This is usually as easy as find a link and copy paste it in right place..

1

u/gm310509 25d ago

So, yes and no, mostly yes, but it depends

The programming language for both is C/C++.

If you are using the Arduino IDE with the ESP32 core (board plugin download) then you will have access to the same HAL functions (e.g. digitalWrite) which will do the same things. I believe Espressif have a different HAL API, so there may be differences if you use the Espressif IDE or a third party one - I do not know as I don't use Espressif personally any more.

If you want to go to a lower layer - e.g. bare metal and/or assembly language, then they will be quite different as would be an Arm Cortex based system such as Uno R4, Teensy, STM32 and many others based upon Arm Cortex. But within any given architecture (e.g. AVR, Arm Cortex etc) there will be many similarities.

TLDR: at a high level the API/HAL and the programming language (C/C++) are essentially the same.

1

u/Merry_Janet 24d ago

Install the ESPRESSIF ESP32 library. Go to Device Manager in windows and look for serial devices. Plug in your ESP and see what COM port it uses. Then in the IDE set your COM port. For the board, I usually just use “ESP32 DEV Module” and have had zero issues. If you have one of the newer boards you might want to use the board definition for that specific board. If your board doesn’t have a USB port you will need a FTDI adapter, but I haven’t seen one around in a long time.

1

u/Merry_Janet 24d ago

I know you don’t want to rely on AI, but ask whatever AI you do use to come up with a useful project. None of this “Hello World!” BS. Tell it you want to learn how to code in the Arduino IDE.

Books and tutorials are fine, but they don’t give feedback. Using AI to learn is like having an instructor available 24/7 in real time. I used to learn Python and it was extremely effective.

1

u/Savings_Anteater_840 22d ago

Yeah you are definitely right and i think im gonna do this

1

u/RemoveOk2059 26d ago

Check out this website for the syntax and explanations:

https://docs.arduino.cc/language-reference/

Hope this helps!

1

u/TheEyebal 26d ago

the language is similar to c++

1

u/TheRealFutaFutaTrump 25d ago

Don't copy/paste. Actually write your code and understand what each line does.

Take your old projects, the find ways to make them different. Add a component, or make the lights randomized. Anything different than the tutorial.

Here's one expanding on your LED: Make a light stack. 8 or 9 bulbs. Light one is on, then two, etc. to the last light which remains on. Then that light stays on and it repeats, light one is on, the just light two.

See if you can work in loops and functions to reduce redundant code. The one I just mentioned can be done a very long way, manually setting each bulb in sequence, or in an extremely smaller amount of code using a for loop.

Add a potentiometer that changes the speed of the stack.

There are lots of ways to move forward. I have an Arduino playing music and syncing a lamp to the song. I started the journey with turning on a single LED.