Hello everyone,
This is a newbie question for the pros of programming, I'm kind of new to programming, I've learned Pascal in school and I quite understand the basics and the logic behind programming and I believe that I can learn quickly to code.
I'm planning to buy an Arduino because I'm a soon going to be an IT student (yay!) and I want to be ahead of my classmates
Anyways my question is fairly simple, I know that Arduino supports so many different language but mainly a little bit of C/C++ which according to experts it's relatively hard to learn so I'm wondering what coding language supported by Arduino do you, pros, suggest for a young student who wants to get into programming?
Thanks in advance!
I would/did just learn the basics of C/C++. You don't really need to learn a great deal of it because Arduino hides some of the complexities and then there are so many useful libraries available that do most of the difficult bits for you.
But just for interest, what are the many other languages that you know Arduino supports?
Steve
C/C++ is the only option using arduino tools. There are some tools that allow programming microcontrollers (generally higher spec ones that can handle the overhead) in other languages (eg micropython/circuitpython for python, nodemcu for lua (though that name also refers to the hardware which can be programmed using other tools), both on esp's, espruino for javascript on stm32, esp, and some of the nrf52 parts); these are applicable only to more limited subsets of microcontrollers (and nothing for the ubiquitous 328p, which cant spare the flash/ram/speed to cover the overhead).
C/C++ is hands down no contest the most broadly useful language for embedded development - stuff written in C/C++ uses less flash/ram and runs faster, and you don't have resources to spare to trade off for a more modern, easier to write, language.
I do still use Espruino for simple "I need an embedded http server" type applications because interacting with the internet world of variable length strings kind of sucks in C, and you can knock something together in espruino js really quickly. The live console is also really nice for trying to understand behavior of new hardware or undocumented devices.
MrYsf:
Hello everyone,
This is a newbie question for the pros of programming, I'm kind of new to programming, I've learned Pascal in school and I quite understand the basics and the logic behind programming and I believe that I can learn quickly to code.
I'm planning to buy an Arduino because I'm a soon going to be an IT student (yay!) and I want to be ahead of my classmates
Anyways my question is fairly simple, I know that Arduino supports so many different language but mainly a little bit of C/C++ which according to experts it's relatively hard to learn so I'm wondering what coding language supported by Arduino do you, pros, suggest for a young student who wants to get into programming?
Thanks in advance!
Hey good idea! You'll want to know that the language most Arduino users work with is referred to as "Arduino C". I'd start with that, using the examples given in the Arduino IDE.
Best,
Englishscone
I've never heard it called "Arduino C". If anything, it would be "Arduino C++", but I've never heard that either. Arduino calls the programming language of Arduino sketches the "Arduino programming language". But it's important to understand that the .ino files of Arduino sketches are compiled as C++ after some minimal preprocessing:
So learn the "Arduino programming language", as documented in the Arduino Language Reference:
then for the many other useful parts of the language that are not documented in the Arduino Language Reference, use a standard C++ reference. I like this one:
http://www.cplusplus.com/
You can use C with Arduino if you like, by adding files to your sketch that have the .c extension, but it is fairly rare. People get away with pretending they are writing Arduino sketches in C because C is a subset of C++, but it's silly to think this way, and will lead to a lot of confusion when you encounter the many uses of C++-specific features in Arduino code and can't find any explanation of them in your C references.
pert:
I've never heard it called "Arduino C". If anything, it would be "Arduino C++", but I've never heard that either. Arduino calls the programming language of Arduino sketches the "Arduino programming language". But it's important to understand that the .ino files of Arduino sketches are compiled as C++ after some minimal preprocessing:
Build Process ยท arduino/Arduino Wiki ยท GitHubSo learn the "Arduino programming language", as documented in the Arduino Language Reference:
Arduino Reference - Arduino Reference
then for the many other useful parts of the language that are not documented in the Arduino Language Reference, use a standard C++ reference. I like this one:
http://www.cplusplus.com/You can use C with Arduino if you like, by adding files to your sketch that have the .c extension, but it is fairly rare. People get away with pretending they are writing Arduino sketches in C because C is a subset of C++, but it's silly to think this way, and will lead to a lot of confusion when you encounter the many uses of C++-specific features in Arduino code and can't find any explanation of them in your C references.
Thank you for your links but I'm on the beginner side of coding so I'm sorry if I'm asking for too much but can you help me find a website that could interactively teach me the basics of Arduino coding?
You need to get your mind right. There is no point in learning a simple language that is a dead end. Learn the language that is the foundation of all modern languages: C.
PERL, Java, everything worth knowing stems from C. Start by learning the one program that leads to all the others. A bit more effort up front, less effort later.
MrYsf:
can you help me find a website that could interactively teach me the basics of Arduino coding?
All the interaction you need is in your Arduino board. Work your way through the Arduino tutorials:
https://www.arduino.cc/en/Tutorial/HomePage
You can skip some if they are not related to your area of interest, but definitely go through ever one of the earlier tutorials.
Upload each sketch to your board. Verify it works as expected.
Now read through the sketch line by line. Make sure you fully understand what each line does before going on to the next one. If there is something you don't understand, look it up in the Arduino Language Reference. If you don't find it there, look in a C++ reference.
Make a small modification to the sketch that changes how the program behaves. Upload it to your Arduino. Verify it works as expected.
Don't move on to the next tutorial until you are sure you understand the current one completely.
C/C++ which according to experts it's relatively hard to learn
I disagree that C/C++ is "hard to learn."
Learning enough C/C++ to qualify as "an expert programmer, able to write complex code" may be difficult, but I think that's true of all languages.
The "Arduino Language" is about sticking mostly to a small subset of C++ that is pretty easy to learn.
(Learning a subset of a language to start out with is always a good idea!)
"I'm kind of new to programming, I've learned Pascal in school and I quite understand the basics and the logic behind programming and I believe that I can learn quickly to code."
Get your arduino and start working with the examples in the IDE. If you need to change or modify the code, look at the "resources" at the top of this page. There is a search function in the the upper right of this page that may provide answers to questions you may have.