Python Forum
Super basic tkinter arduino issue
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Super basic tkinter arduino issue
#1
Hi
doing a basic read and display exercise.

Does anyone know how to do a basic print data from arduino onto
Tkinter with python?

(i dont!! lol)

ive looked everywhere on the web and cant find a source for this most are doing lots more and more stuff breaks..


with my basic python code i can read the arduino measurements.
super minamalist
import serial
ser = serial.Serial('/dev/ttyACM0', baudrate = 9600, timeout=1)

while 1: 
    
	arduinoData = ser.readline().decode('ascii')
	print(arduinoData) 
This gives me no window

 
import serial
from tkinter import *
from time import sleep

ser = serial.Serial('/dev/ttyACM0', baudrate = 9600, timeout=1)  


values = []
root = Tk()
root.geometry('600x200')

cnt=0
var = StringVar()



e = Entry(root,width = 35, textvariable = var ,borderwidth = 5)
e.grid(row = 0, column = 0, columnspan = 3,padx = 10,pady = 10)
  
while 1: 
    
	arduinoData = ser.readline().decode('ascii')
	print(arduinoData) 

var.set('My Var')
root.mainloop()
Reply


Messages In This Thread
Super basic tkinter arduino issue - by Kurta - Jan-07-2021, 04:14 AM
RE: Super basic tkinter arduino issue - by Kurta - Jan-07-2021, 04:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb [Tkinter] Tkinter Class Import Module Issue AaronCatolico1 6 3,298 Sep-06-2022, 03:37 PM
Last Post: AaronCatolico1
Photo tkinter issue mate 4 2,630 Dec-06-2020, 09:03 PM
Last Post: mate
  Issue in Tkinter with winfo_class() and LabelFrame ReDefendeur 1 2,795 Oct-05-2020, 05:52 AM
Last Post: Jeff900
  [Tkinter] tkinter: after issue edwin6938 1 3,481 Aug-25-2020, 04:37 PM
Last Post: Larz60+
  Tkinter: increasing numbers and Radiobutton issue PeroPuri 1 2,216 Apr-13-2020, 05:48 PM
Last Post: deanhystad
  [Tkinter] tkinter issue with variables carrying over between functions PengEng 1 1,805 Apr-06-2020, 06:13 PM
Last Post: deanhystad
  Issue on tkinter with buttons Reldaing 1 2,495 Jan-07-2020, 08:21 AM
Last Post: berckut72
  [Tkinter] Tkinter window issue frequency 4 3,440 Dec-24-2018, 10:49 AM
Last Post: frequency
  Tkinter positional information issue thatguy14 4 3,512 Jul-05-2018, 06:49 PM
Last Post: woooee
  [Tkinter] Tkinter widgets driving Arduino uno output pins woodcncwnc 3 4,654 Jan-29-2018, 08:21 PM
Last Post: woodcncwnc

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020