1

I am a Python programmer and want to learn Arduino programming so want to know what are the main differences between Python and Arduino C++ programming?

Is Arduino C++ more complex than Python programming?
Are there any similarities that will help me? Are there any formatting restrictions like in Python? Etc...

According to this page(printing hello), Aurdino programming looks easy to me.

Code Gorilla
  • 5,637
  • 1
  • 15
  • 31
ShopiMacros
  • 37
  • 1
  • 5
  • 2
    What is the difference between python and arduino programming? -- Everything. – Majenko Jul 11 '17 at 17:34
  • Heh. As usual, @Majenko is correct. This is like asking what the difference is between FORTRAN and COBOL. From this question it sounds like you don't really know either Python nor C++ – SDsolar Jul 12 '17 at 03:00
  • @SDsolar I know python but not C++ – ShopiMacros Jul 12 '17 at 06:07
  • @ShopiMacros - If you know one language learning a second is easier than learning a first. Start with small examples and work up. – Code Gorilla Jul 12 '17 at 07:03
  • @CodeGorilla , Got It – ShopiMacros Jul 12 '17 at 07:25
  • I agree with the Gorilla. If you really want to have fun, look at this link. It shows how to say "Hello, World" in 28 different languages.. It is interesting to see the similarities and differences. Both Python and C++ are in there. https://excelwithbusiness.com/blog/say-hello-world-in-28-different-programming-languages/ – SDsolar Jul 12 '17 at 07:37
  • Python works great on everything except Arduino, where you use C++. It is amazingly easy to use Arduinos. Start with the built-in examples, like Blink. Here is an article on that subject: https://www.arduino.cc/en/Tutorial/BuiltInExamples – SDsolar Jul 12 '17 at 07:40
  • @SDsolar Its interesting alot. – ShopiMacros Jul 12 '17 at 07:40
  • Have fun with it! The best thing about programming is that you have the freedom to control everything. The worst thing about programming is that you have to control everything. That was the joke when I was in CS school. – SDsolar Jul 12 '17 at 07:42
  • btw, please edit your question here and make it very clear that you are a Python programmer and want to know how hard of a leap it might be to use C++ on Arduino. You have said plenty in the comments that, if included in the question, might even get the hold released. – SDsolar Jul 12 '17 at 07:46
  • @SDsolar is there anything missing now? – ShopiMacros Jul 12 '17 at 07:53
  • Your edit only makes this question worse. Fundamentally, it does not fit here. – Chris Stratton Jul 12 '17 at 08:14

1 Answers1

1

Arduino uses a language that is derived from Processing, which looks like C++.

Python is a different language, although both have similarities (both Object Oriented for example).

What is 'complex' depends on what your background is. C++ is in general more complex than Arduino, but most people using Arduino program in C++, so most examples can be found in C++, which makes support from other users easier.

If you are new to programming, I suggest using the 'standard' Arduino IDE.

To be complete, Arduino is not a programming language, it is a platform. In general, every language can be used to write Arduino code, but only a few have compilers for creating Arduino (machine) code.

Michel Keijzers
  • 12,954
  • 7
  • 40
  • 56
  • 3
    Arduino uses the gcc compiler which is 100% 'c++'. The 'c++' includes automatically 'c' (although some would say that is is no longer pure 'c' because there are very tiny differences for example with keywords that are needed in 'c++'). On top of the 'c++' the Arduino platform has put an extra sauce. That extra layer can be a blessing or a curse or just confusing. In my opinion it is a little of each of those three things. Newer Arduino boards have faster processors and more memory, so there is no more holding back to use 'c++' to the full. – Jot Jul 11 '17 at 17:23
  • 2
    @Jot> well, there are C constructs that do not exist in C++. C++ doesn't include C, only a subset of it. – spectras Jul 12 '17 at 07:13
  • 1
    It sure is easy to get sidetracked by discussions about languages. For Arduino I say just do what @Michael says and use the Arduino IDE (and the built-in examples) to get into the mindset. – SDsolar Jul 12 '17 at 07:44
  • I tried to make my answer suitable to the one who asked ... Jot is right mostly that C++/C and the Arduino 'language' are similar, but from a start point of view, it's best to start simple (which is the Arduino IDE). – Michel Keijzers Jul 12 '17 at 08:57
  • Understood. I like your answer so upvoted. It was a challenge to answer it as asked. @Chris improved the body but I still think the title is not compelling enough for people to find this one after it is not new and goes inactive. – SDsolar Jul 12 '17 at 09:23
  • @SDSolar Thanks ... and also it's partly opinion-based (what is complex or not). E.g. for me electronics is more complex than programming, since I have more experience in the latter. Some people like OO, others prefer non-OO etc. – Michel Keijzers Jul 12 '17 at 12:37