python - .append() method with pyserial and arduino gives me ridiculous output -
i' m trying voltage arduino, , make array them.
arduino code below:
void setup() { serial.begin(9600); } void loop() { int sensorvalue = analogread(a0); float voltage = sensorvalue*(5.0/1023); serial.println(voltage); } on serial monitor, seems fine.
when try make array python, used code:
import serial ser = serial.serial("com5", 9600) voltage = [] while true: volt = ser.readline() voltage.insert(volt) print voltage just gave me not array voltage measurements. tried .apppend() , .extend(), same results.
Comments
Post a Comment