Need to constantly monitor serial data in Python

Posted by jakke34 on Stack Overflow See other posts from Stack Overflow or by jakke34
Published on 2010-05-02T07:53:55Z Indexed on 2010/05/02 8:07 UTC
Read the original article Hit count: 164

Filed under:
|

Right now I am using an arduino to send data from an analog sensor to COM4. I am trying to make a python script that continuously monitors that data and looks for a certain parameter.

I tried something like this but it isn't outputing the data like I want.

import serial

port = "COM4"
ser = serial.Serial(port,9600, timeout =1)
value = 0

while 1:
    value = ser.read()

    print value

© Stack Overflow or respective owner

Related posts about python

Related posts about serial