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.

192 questions
41
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,903
  • 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…
10
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
  • 281
  • 3
  • 4
  • 9
5
votes
1 answer

ESP32 SocketIO Client is not connecting to Flask-SocketIO Server

I'm trying to connect a ESP32 client using SocketIO with a Flask-SocketIO server and it's not getting connected. The server uses SSL. The local server address is https://192.168.1.137:3000.Is the https causing issue here? The following is the output…
Shyam3089
  • 165
  • 4
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
  • 553
  • 2
  • 6
  • 12
5
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
  • 245
  • 1
  • 4
  • 10
5
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
  • 151
  • 1
  • 1
  • 3
3
votes
1 answer

How to ignore garbage values in serial communication between arduino and python

I have arduino uno. I am trying to send and receive serial data from arduino to python. I have usb to uart converter. I have connected its tx to rx of Arduino and rx to tx of Arduino and gnd is connected to gnd. I have connected this usb to my…
S Andrew
  • 183
  • 9
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
1 answer

How can I use Python from a sketch?

I'd like to be able to use Python from a sketch. According to the Arduino playground, one can use PySerial from a computer to talk with an Arduino via Python. It looks like from that page you can also use various API's to use Python with an Arduino…
hichris123
  • 337
  • 1
  • 3
  • 19
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
2 answers

Bidirectional communication between Arduino and Raspberry Pi over USB possible?

Is it possible to have bidirectional communication betweeen an Arduino Uno Rev 3 and a Raspberry Pi Modell B+ running Rasbian? They're connected ofer USB, and it would be good if I could use Python on the Pi.
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
  • 6
  • 17
1
2 3
12 13