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.
17 questions
41
votes
10
answers
178k
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 ...
5
votes
1
answer
5k
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
3
answers
8k
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 ...
10
votes
2
answers
35k
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 ...
1
vote
2
answers
15k
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 ...
0
votes
1
answer
15k
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 ...
0
votes
1
answer
14k
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
1
answer
312
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 ...
0
votes
2
answers
8k
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 ...
2
votes
3
answers
2k
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 ...
2
votes
2
answers
17k
views
Arduino Serial Communication with Python: sending an array
I am a bit new to both Arduino and Python. My aim is to send commands to Arduino to run a stepper motor. I need to send an array containing the parameters. After consulting many earlier posts like:
...
2
votes
3
answers
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
2
answers
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 ...
2
votes
1
answer
1k
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 ...
1
vote
2
answers
9k
views
Sending Float values from Python to Arduino via serial communication
I want to Control the current flowing through a circuit using an Arduino. I have trained a PID controller for this purpose. I am using a current sensor to determine the error. It runs successful on my ...