You could utilize the pyserial library to catch the data by means of the serial port at that point process the information using python, in which case the accompanying code would do:
import serial
import struct
ser = serial.Serial('COM6',9600) #put the port number and the communication rate
BUFFLEN = 3 #constant
buffer = [ 0x05, 0x0D, 0x02, 0xFF, 0x10, 0xAA ] #array
i=0 #initialize control variable
def clamp(n, minn, maxn):
return max(min(maxn, n), minn)
while (i < BUFFLEN):
val = ser.read()
val = clamp(val,0,1023)
buffer[i*2] = (i<<2) or struct.pack('<h', val)
buffer[i*2+1] = struct.pack('>h', val)
i+=1 #increment
However, make sure to catch and print the information to serial from the Arduino IDE
Are you interested to learn the concepts of Python? Join the python training course fast!