Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Conditional Button Press
#4
This is a tkinter button press. So GUI, a simple Stop button to end the loop. Here is the exact code I am working with.

 
  def callback():
       while True:
           ADC_Value = adc.read_adc_difference(0,gain = GAIN)
           print(ADC_Value, "ADC Value")
           sleep(2)
           x_Input = (((ADC_Value-68)*(1/8002.0))*(1/2.4))-0.25
           print(x_Input, "Current Pressure")
   t = threading.Thread(target = callback)
   t.start()
This would probably solve itself if I could find the tkinter library in my directory.
Reply


Messages In This Thread
Conditional Button Press - by Raudert - Mar-16-2017, 08:54 PM
RE: Conditional Button Press - by micseydel - Mar-16-2017, 09:10 PM
RE: Conditional Button Press - by nilamo - Mar-16-2017, 09:11 PM
RE: Conditional Button Press - by Raudert - Mar-17-2017, 01:18 PM
RE: Conditional Button Press - by Larz60+ - Mar-17-2017, 01:31 PM
RE: Conditional Button Press - by Raudert - Mar-17-2017, 01:47 PM
RE: Conditional Button Press - by Larz60+ - Mar-17-2017, 01:51 PM
RE: Conditional Button Press - by Raudert - Mar-17-2017, 02:06 PM
RE: Conditional Button Press - by Larz60+ - Mar-17-2017, 07:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to break out of a for loop on button press? philipbergwerf 6 1,874 Oct-06-2022, 03:12 PM
Last Post: philipbergwerf
  tkinter auto press button kucingkembar 2 3,289 Dec-24-2021, 01:23 PM
Last Post: kucingkembar

Forum Jump:

User Panel Messages

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