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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -