I am having difficulty reading serial data coming from an arduino over a serial connection. In order to get around the issue of serial and the gui needing to be running simultansouly, I am using the .after function to call the update serial every 100ms. However, when I run this code, I get no window popping up, and I get an error saying I have exceeded the max recursion depth. Here is my code:
'''
Created on Nov 23, 2014
@author: Charlie
'''
if __name__ == '__main__':
pass
import serial
from tkinter import *
ser = serial.Serial('COM8')
ser.baudrate = 9600
def update():
c = StringVar()
c=ser.readline()
theta.set(c)
root.after(100,update())
root=Tk()
theta = StringVar()
w = Label(root, textvariable = theta)
w.pack()
root.after(100,update())
root.mainloop()