I am working on project in which I am getting data from Arduino serially and accessing them into Python.To access data from arduino I am using pyserial. After that I have to display that data on Python GUI.
How can I do this?
I am getting this data in Arduino Serial Monitor....
2.00
2.64
3.28
3.92
4.56
5.20
5.84
6.48
7.12
7.76
8.40
9.04
9.68
10.00
9.69
16.59
23.50
30.40
37.31
44.21
51.11
58.02
64.92
71.82
78.73
82.18
And using pyserial I am getting this data as python output...
[2.0]
[2.0, 2.64]
[2.0, 2.64, 3.28]
[2.0, 2.64, 3.28, 3.92]
[2.0, 2.64, 3.28, 3.92, 4.56]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59, 23.5]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59, 23.5, 30.4]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59, 23.5, 30.4, 37.31]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59, 23.5, 30.4, 37.31, 44.21]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59, 23.5, 30.4, 37.31, 44.21, 51.11]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59, 23.5, 30.4, 37.31, 44.21, 51.11, 58.02]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59, 23.5, 30.4, 37.31, 44.21, 51.11, 58.02, 64.92]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59, 23.5, 30.4, 37.31, 44.21, 51.11, 58.02, 64.92, 71.82]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59, 23.5, 30.4, 37.31, 44.21, 51.11, 58.02, 64.92, 71.82, 78.73]
[2.0, 2.64, 3.28, 3.92, 4.56, 5.2, 5.84, 6.48, 7.12, 7.76, 8.4, 9.04, 9.68, 10.0, 9.69, 16.59, 23.5, 30.4, 37.31, 44.21, 51.11, 58.02, 64.92, 71.82, 78.73, 82.18]
In python I have used this code to get Serial data....
import serial
arduino = serial.Serial('COM5', 9600, timeout = .1)
arduino_data = [] # declare a list
while True:
data = arduino.readline()
if data:
arduino_data.append(float(data)) # Append a data to your declared list
print arduino_data
pyserialandarduinoin your question, when it seems to be all about how to display data in python gui? Could you be a little more specific on how you want to display your data? Could you provide a data example? note: edit your question to add relevant information, don't use comments for that.pyserial output.