Questions tagged [python]

Python is a programming language. Use this tag for questions regarding how to use Python with your Arduino, or on using of pySerial or such software. Also consider using [programming] and other specific tags.

Python is a programming language. It is often used as a scripting language, but has many other uses.

Use this tag for questions regarding how to use Python with your Arduino, or on using of pySerial and other software that lets you use Python on an Arduino.

Also consider using and other tags more specific to your problem.

This page on the Arduino website should help you to get up and running using Python with an Arduino. The main way to use Python with an Arduino is by using pySerial. pySerial is a desktop program compatible with Windows, Linux and other OS's. It is used to execute Python commands on an Arduino.

182 questions
40
votes
10 answers

Programming an Arduino using Python, rather than C/C++

I am not very skilled with the C Language and I was wondering if there is a way in which python could be used to program an Arduino. This would most likely require a different IDE in order to be able to debug the scripts them self.
JVarhol
  • 1,823
  • 2
  • 17
  • 22
12
votes
1 answer

Update Dynamically Tkinter Widget Scale from Arduino Ports using python and firmata

I'm having trouble trying to get Arduino digital ports values and set these values into a Python Tkinter Widget Scale. I'm using Python and Arduino with Firmata. I'm able to access my arduino board with python code. For example in a label widget…
9
votes
2 answers

How to send numbers to Arduino UNO via Python 3 and the module serial

I am new to Arduino (and computer programming in general), so I apologize if this question looks silly. Once I set up a basic arduino-LED connection, I have problems sending INTEGERS to arduino through the serial port. I can easily send characters…
mickkk
  • 271
  • 3
  • 4
  • 8
5
votes
3 answers

Arduino serial port reset in Serial monitor & Python

So am I using an Arduino with a shield to gain some voltage values for an ECG. I am then plotting that data in Python. However whenever I "observe" the serial port, be that through the Arduino serial monitor or in attempting to plot the values of…
hawkar
  • 513
  • 2
  • 6
  • 11
4
votes
1 answer

Problem sending string with Python to Arduino through serial port

I want to send string 50 to Arduino through serial port, the Arduino UNO seems it communicates with port COM25 but it doesnt receive the string properly: import serial # if you have not already done so ser = serial.Serial('COM25') ser.baudrate =…
floppy380
  • 225
  • 4
  • 9
4
votes
5 answers

Can't communicate with arduino using python (Windows)

I am new to programming and am trying to communicate with my arduino using python through serial communication. I am using the following code: Arduino code: int ledPin = 11; void setup() { Serial.begin(9600); pinMode(ledPin,OUTPUT); } void…
Severus
  • 141
  • 1
  • 1
  • 3
3
votes
2 answers

get data from arduino using python

I am trying to read potential meter data from Arduino using python, with the program on Arduino as follows : #include SerialData serialData; int sendVals[2]; void setup() { serialData.begin(9600); } void loop() { int potVal =…
3
votes
0 answers

Run Servo when detect object on OpenCV Python

I want to connect OpenCV (Python) with arduino Uno when it detects a tennis ball. OpenCV code: import numpy as np import cv2 import serial face_cascade = cv2.CascadeClassifier('tennisballdetect.xml') cap = cv2.VideoCapture(0) while 1: ret, img =…
sayem48
  • 31
  • 1
  • 2
3
votes
4 answers

Which Arduino is the most suitable for my project?

I've started to prototype something using an Arduino Mega and Yún Shield. It's simple. It reads an ADC at 50Hz and sends data to a server through a socket. But because of that combination, I need to use Bridge to send data through the socket. It's…
3
votes
1 answer

Read/write data from 2 Arduinos simultaneously with Python

So for my project I have one Arduino Mega hooked up with a quadrature rotary encoder which is connected to the computer. An Arduino Uno is connected to a circuit I built, which in turn is connected to a valve and a touch connector (also connected to…
Max
  • 31
  • 2
3
votes
1 answer

Graph plotting on Python using Tkinter Canvas

I'm trying to plot a graph with python using the canvas widget, I'm currently sending data in from an arduino sensor sketch ..does anyone have an idea on how I can plot this graph in real time on Python using canvas. I've read up on it but I'm…
dada
  • 127
  • 3
  • 5
  • 17
2
votes
0 answers

Robust communication between Xbee and Python

I am using Xbee API library for Python to process the data received by the Xbee module. I am wondering how to construct the robust protocol for sending and receiving data. What I would like to build is send the data request message to power…
Jinkyoo Park
  • 81
  • 1
  • 5
2
votes
0 answers

Initial setup print getting cut off from printing

I am writing a program in Python (using PySerial) that needs to read data from the Arduino quickly. For this reason I have set the serial timeout to 0.01 seconds. (Baud rate is 115k) If I don't set the timeout this low I run into issues with there…
ngpop
  • 21
  • 1
2
votes
1 answer

What is the difference when an arduino has been unplugged vs when a serial port connection was closed?

Using python code for a serial port connection to an arduino, it sends a value to the arduino, which then starts printing values to serial. The python code will print the value on the first or second run (if run soon enough after), but after that it…
2
votes
1 answer

share enum between python and arduino

I have created a gui in python that allows an arduino controlled mecanum wheel cart to move around. The cart allows for 8 different move directions and can rotate left and right. Commands are sent over a serial connection between the laptop(w10,…
juerg
  • 121
  • 2
1
2 3
12 13