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.

Filter by
Sorted by
Tagged with
39
votes
10answers
168k views

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

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 ...
5
votes
2answers
6k views

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 ...
9
votes
2answers
32k 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
1answer
12k views

Pyserial serial.write() doesn't work

I need to communicate with an Arduino. When I use serial.readline() to read what Arduino has to say it works fine. But when I useserial.write('something') doesn't seem to do anything. Interesting ...
-1
votes
1answer
12k 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 ...
2
votes
1answer
908 views

What's the problem with baudrate?

I was trying to evaluate the speed of communication between pc and Arduino, using this code in Arduino: void setup() { Serial.begin(9600); } void loop() { Serial.println("Ciao Arduino"); } and ...
2
votes
3answers
1k 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 ...
1
vote
2answers
13k 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 ...
2
votes
3answers
7k views

Receiving two-byte int values over serial

I am using Python smbus write_word_data method to send int values from a Raspberry Pi to an Arduino using I²C. This seems to be the correct method. When I send values from 0-255, I see the following ...
2
votes
2answers
4k views

Python - Arduino communication not reliable

I'm trying to establish basic communication between python and my arduino due. I have managed to get a message sent to the arduino and sent back, but the code that achieves this task does not give ...
1
vote
1answer
1k views

Serial available doesn't work right after upload

I have 2 programs to test serial communication, an simple arduino program that echoes whatever is on the serial port and a python program that writes to the serial port and prints the reply. I'm ...
0
votes
2answers
682 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 ...
0
votes
2answers
7k 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 ...