1

Does anyone know how do I get Arduino and Python talking to each other? I would essentially like to write my code and export it somehow to the arduino-uno.

  • Other than with pyserial? – Ignacio Vazquez-Abrams May 9 '18 at 17:02
  • No, can I use Pyserial? – Datalink May 9 '18 at 17:13
  • 1
    For a python interpreter running on a microcontroller you need quite a lot of ressources (flash, SRAM, speed,..). Consider to either change the board to something like an ESP8266, ESP32 or Feather M0, or live with C/C++ and the smaller boards. The Arduino Uno simply can't run it on 2KB RAM and 32kB Flash. – Maximilian Gerhardt May 9 '18 at 18:15
  • So how would I get Python to interact with Arduino? – Datalink May 9 '18 at 19:10
  • 1
    'Arduino' is a framework, a set of library functions which you can use to make your microcontroller do something, so to say. When you use the language Python with MicroPython or CircuitPython, you're using that new framework. Then it's not running an Arduino Core anymore. – Maximilian Gerhardt May 9 '18 at 19:22
2

You can not run python on an UNO. If you want to use python on a microcontoller you should look into boards supported by MicroPython or Circuit Python

| improve this answer | |
-1

The Arduino communicates with the PC (and vice-versa) normally using Serial. You can use the PySerial module in your python code to open the Arduino's serial port and read and write data, and the Serial object in your Arduino code likewise.

What that data is, and what it means, though is up to you to decide upon and program.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.