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.

learn more… | top users | synonyms

0
votes
0answers
17 views

Sync arduino-python transmision

I'm communicating two Arduinos with RF modules. One of them is: controlling a process measuring an analog input sending the measurement to the second Arduino The second Arduino is connected to a ...
0
votes
0answers
12 views

Python ImportError: No module named yahoo_finance [migrated]

I am new to the Arduino & Python community. I tried to implement the following project: ...
0
votes
1answer
33 views

Send a file from PC to Arduino using HC-06 module

I want to send a file from my Laptop using its own Bluetooth transmitter to Arduino. Arduino has HC-06 module as receiver.Arduino has SD Card fore store the file. I was able to send bytes using Python ...
1
vote
2answers
33 views

SDS011 Dust Sensor Checksum Error

I'm working with an SDS011 particular sensor through its serial interface. The spec sheet (http://inovafitness.com/upload/file/20150311/14261262164716.pdf) indicates that the second to last byte of a ...
0
votes
1answer
23 views

Arduino Yun Python ImportError: No Module named mime.multipart

So, I have an Arduino Yun, and I'm trying to send an email with python. I have this code that I got from https://github.com/amicojeko/YouCantTouchThis But when I try to call the file with $python ...
0
votes
1answer
28 views

How can I control neopixels attached to a Digispark?

I want to use a string of Neopixels attached to a Digispark hanging off of a RasPi3 as indicators for various situations. For example: a motor (connected to a driver hat on the I2C bus of the RasPi) ...
0
votes
1answer
38 views

serial communication dead slow after a while

I'm workin on a node for blender to control an arduino. I notice it goes really slow after a while so I isolated the problem. It is good in maintaining 60 frames a second, then after around 40 seconds ...
1
vote
0answers
15 views

Send Newline / Carriage return with python

With the Serial Monitor I have the Newline option: How can I send the same using python? I tried: 30\r\n 30\r 30\n import serial ser = serial.Serial('COM3', 115200) while True: ...
1
vote
0answers
70 views

How to read data from arduino with raspberry pi via I2C

I have connected Raspberry pi 2 model B with arduino uno via Bi-Directional Level shifter, from this BLOG Raspberry pi GND ---------- GND Arduino 3.3v ---------- 5v ...
0
votes
2answers
48 views

Script on pc only gets 640 characters via serial

I experience that if the Arduino (Teensy 3.2) writes a rather long stream of characters to serial, the python script on the other end only receives the first 640 characters. I have found this result ...
1
vote
1answer
90 views

Unpacking arduino binary data on a python sketch

as a follow up to my earlier post Simultaneously reading data from multiple serial ports, I am stuck trying to develop a python sketch that can read the incoming serial data from the com port on my ...
1
vote
0answers
38 views

BLE Python with GUI on OSX

Has anyone connected BLE devices with Python + GUI on OSX? I've looked into a few libraries (most are old), but one that has the most success if Adafruit's BlueFruit library. However, this library ...
0
votes
3answers
41 views

Led issue with arduino controled by raspberry pi/python

I'm having an issue with my project. My project is 8 leds and a potentiometer on an arduino being read and controlled by a raspberry pi running python. when I'm using a potentiometer the signal is ...
1
vote
1answer
59 views

How do I go about building a backend for my Arduino device? [closed]

I am new to Arduino, but I am putting together a project in which the Arduino Uno has multiple sensors (temperature, humidity, etc) collecting data. Right now all it is currently going to do is get ...
0
votes
1answer
114 views

Python PySerial with Arduino fails byte check

I'm struggling with my first steps with Python and PySerial. I have one Arduino which reads impulses from an electricity power meter, passes the counts over to another Arduino over an RF link and then ...
1
vote
1answer
44 views

Does WiFiClient work on a Yún to send data over a certain IP and port to be received by a Python socket?

I haven't been able to get the example code from the page WiFi:Client:connect() to work on my Arduino Yún. Is this not how I'm supposed to send data over WiFi to be read by something like a socket? ...
2
votes
3answers
107 views

Share data between the two processors of the Arduino Yun

The linux processor runs a Python script from which I would like to send an array of integers to the Yun microprocessor. How can I do that? And then, how can I retrieve and then use this array in my ...
4
votes
0answers
250 views

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 ...
1
vote
1answer
101 views

How to make data sent by Python (via serial connection) wait for Arduino to finish current task?

I am trying to make my Arduino micro-controller and my Mac talk together, and I have created a functional serial connection. My computer is sending data to my Arduino, and my Arduino is sending a 1 ...
1
vote
2answers
119 views

Python script to toggle LED's

I have 8 LED's connected to a shift register on my arduino uno r3. I am trying to write a Python3 script that will prompt a user to select one of the LED's and then prompt to toggle on or off. Should ...
1
vote
1answer
676 views

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 ...
-1
votes
3answers
1k views

Plotting a real time graph of sensor data from Arduino on Processing, MatLab or Python

I have an accelerometer connected to my Arduino Due to spit out data on my serial monitor as described in my earlier post. I'm trying to find a sketch I could use to plot a continuous real-time graph ...
-1
votes
1answer
211 views

Advanced Line Follower robot

I know about line follower mainly the grid solving robots i know the basics actually. Actually they have to trace the path of the grid in an arena and then reach back to starting point in a shortest ...
-1
votes
1answer
387 views

pySerial and serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected?)

I'm having some trouble getting my arduino uno to communicate with a simple python script through pyserial. Lets start with my arduino sketch: void setup() { Serial.begin(9600); } byte i = 0; ...
0
votes
0answers
42 views

unable to send text from Python to Arduino correctly

The easiest options after some digging seemed to be using Python and PySerial. I want my Python program running on the PC send string "1" to Arduino and Arduino to properly read it and do something. ...
-1
votes
1answer
822 views

Serial.readString() - how does it work exactly?

Someone posted a solution for a problem I had which used Serial.read() .Why doesn't readString() seem to work though? From the docs it seems it reads the data as a String object which would make ...
0
votes
1answer
355 views

Pyserial serial.write() doesn't work

I need to communicate with an Arduino. Doing serial.readline() to read what Arduino has to say works fine. Doing serial.write('something') doesn't seem to do anything. What is interesting is that if ...
0
votes
1answer
85 views

make Arduino tell when the Python program stops reading from the Serial (crash, etc)

Here's the Arduino code: void setup() { Serial.begin(9600); pinMode(7, INPUT_PULLUP); } void loop() { int val = digitalRead(7); if (val == HIGH) { Serial.print("1"); } else ...
0
votes
1answer
322 views

arduino due-Python interfacing for high speed data rate

Four our project, I want to send data mesured by an Arduino due to a computer via Pyton very vast. So I tried to make a simple benchmark by sending 10240 int datas to determine the time it take. In ...
0
votes
2answers
223 views

Send numbers to arduino via serial port using python

I have a file with numbers called fginputs.txt. For example it could be something like this: 4958 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4154 4958 I want python ...
-1
votes
1answer
104 views

Pyserial and Arduino

I am trying to send an integer value from Python to Arduino. The integer value is a position given by a webcam, which will determine how many turns a stepper motor moves. Arduino: #include ...
1
vote
1answer
588 views

Handle reading timing in Python using pySerial

I'm not sure about how to properly handle timing readings from serial inside a Python script. I need to read a value every 5 seconds. From Arduino I could do, Serial.println(value); delay(5000); // ...
0
votes
1answer
44 views

Transmitting sketches to Yun with Autobahn - a byte at a time?

I am using this tutorial to connect an Arduino Yun with a browser using Autobahn. In the python file in the above repo, there is this code: def controlLed(self, turnOn): if turnOn: ...
0
votes
2answers
1k views

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() { ...
1
vote
2answers
1k views

Send multiple int values from Python to Arduino using pySerial

I'm trying to send 3 ints in the range of 0-180 from Python to the Arduino Uno device using pySerial (py3K). I have managed to send 1 int by using python's struct lib (not sure if it's the best or ...
1
vote
0answers
93 views

Servo position initiaition using PySerial unexpected results

Hi I'm using Brian Wendt's code for setting up my Arduino Nano with 4 servos using PySerial which works perfectly. So my next step was to get a nice GUI with sliders to position the servos, again no ...
0
votes
1answer
86 views

Serial, Numbers sent as Floating Point and Characters are different at 1e-8 level

I have some code that generates random numbers on the Arduino, it then sends these random numbers firstly, using Serial.print(float data,int lenght) and as a floating point number using the following ...
-3
votes
3answers
3k views

Arduino Raspberry Pi USB Communication [closed]

I am trying to connect an Arduino and Raspberry Pi over USB. I would like to send serial commands, just like the serial monitor in the Arduino IDE. I know how to do this on the Arduino end but I'm ...
1
vote
0answers
456 views

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 ...
0
votes
3answers
541 views

Can I program Arduino with Python? [closed]

I know that I can program Arduino with python but is it possible to make every project, which can be completed by normal IDE?
0
votes
1answer
84 views

Which IDE should I use to write Pythonic-programs for Arduino

I'm doing my first baby-steps to build tools using Arduino. I'd like to know if there is a way to write python scripts to build programs for Arduino. Most of IDEs I found are non-supported IDEs. Is ...
0
votes
2answers
552 views

Sending a floating point number from python to arduino

I am trying to send a floating point number from a python script to an Arduino. I am not sure how to do this, especially in a pythonic way. A little bit of research brought me to this very similar ...
0
votes
1answer
258 views

How would I establish a serial connection with python without using the serial monitor? [duplicate]

How would I establish a serial connection with python without using the serial monitor? What I want to do is give my python script some input and have the arduino do something (blink for example) I ...
0
votes
2answers
274 views

How to send two different sets of int numbers over serial?

I have a project that require for the main computer to do most of the processing then for it to send the X and Y coordinates of this processing to the arduino. This at the time didn't seem very hard ...
6
votes
2answers
4k views

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 ...
0
votes
3answers
3k views

Receiving 2byte int values over serial

I am using Python smbus write_word_data method to send int values from a Raspberry Pi to an arduino. This seems to be the correct method. When I send values from 0-255, I see the following in my ...
1
vote
1answer
446 views

Debugging i2C from Mac OSX desktop

I have a raspberryPi and Arduino connected via i2C. On the RPi I have a python script that takes int values and simply sends them to the RPi, which in turn echoes them back. I am trying to debug this, ...
1
vote
0answers
112 views

i2C and lost connections with IO errors

Having issues troubleshooting IO errors using i2C . Running a Python script on a raspberry Pi as master talking to an Arduino slave. The problem is that when making any change in my code that results ...
0
votes
1answer
332 views

Best way to interact arduino and python

So, i've worked with the pySerial module for python, where I communicated with my arduino via serial. However, this module only works for 32bits and I would like to make my project work on both ...
0
votes
3answers
5k views

Why does serial port stop sending data?

I'm using an Arduino Leonardo to interface with two pressure sensors and Python on my laptop, a MackBook Pro. I'm using arduino IDE V. 1.5.4, Python V. 2.7.6, and OSX 10.8.5. One pressure sensor is ...