Can I use Python to program Arduino?

Im a beginner in both programming and Arduino so excuse the naiveness.

But what language does Arduino natively use?

Just wondering if I can program my Arduino using only Python?

Would i need some sort of 'translator" from C to Python?

Atmel data sheet shows assembler and C examples.
So you probably could, but it would be more work than a first time programmer could handle.

While you can't use python to program an Arduino, you can
use python on a host to control the pins on an Arduino that is running firmata.

You can google around for information.
Just google for:
Firmata python

Here are a few links to get you started:
http://firmata.org/wiki/Main_Page
http://playground.arduino.cc/interfacing/python

--- bill

The Arduino IDE uses C++ to program the Arduino boards.

C (in all its variants) is a compiled language and the compiler coverts your C++ code into the assembly code used by the Atmel chips on the Arduino boards.

Python is an interpreted language that relies on the PC having an "interpreting" program working in the background. In general, the Arduino chips don't have enough memory to hold a Python interpreter.

In practice you will need to learn enough C++ to program the Arduinos as well as Python for your PC programming. Many of the general programming concepts apply in all languages. If you go through the many Arduino examples you should pick up the C++ stuff easily enough. An important difference between C++ and Python is that in C++ you must define the type of every variable before you use it. Also, you will need to remain conscious of the fact that the Arduino is very limited in the amount of program space and RAM compared to a PC. Generally you never need to think about memory limitations on a PC.

As someone else mentioned you can use Python programs on your PC to interface with Arduino devices.

Have fun.

...R

1 Like

Hi everyone! Thank you so much for the guidance.

I came across this video on Youtube: Python Meets the Arduino - YouTube

Thanks again, looking forward to my Arduino journey :wink:

That guy got a lot of details wrong. I'm guessing he was still new to Arduino.

I have a Mega with a 512k SRAM expansion, there are many AVR's that can directly address external SRAM out to 64k before bank switching is needed. The 512k board cost me $25 on a Rugged Circuits sale.

Aren't Python interpreters written in C? And how great is Python without an OS or shell beneath it?