Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Halting if command if gpio triggered event triggered
Post: RE: Halting if command if gpio triggered event tri...
I ended up having to add if statements within the range statements to trigger different behaviors based upon GPIO triggering and end range behavior. The other thing I found is that I either have a ba... |
|
knoxvilles_joker |
General Coding Help |
7 |
3,242 |
Jun-21-2021, 01:27 AM |
|
|
Thread: Halting if command if gpio triggered event triggered
Post: RE: Halting if command if gpio triggered event tri...
I did some more playing. I integrated another piece, that works. The stepper motors I had to do some tweaking.
#!/usr/bin/python
import cwiid
import RPi.GPIO as GPIO
import sys
from time import *
... |
|
knoxvilles_joker |
General Coding Help |
7 |
3,242 |
Jun-21-2021, 01:16 AM |
|
|
Thread: Halting if command if gpio triggered event triggered
Post: RE: Halting if command if gpio triggered event tri...
(Jun-13-2021, 01:50 PM)deanhystad Wrote: Only allow motion when the associated limit switch is not pressed.
stepper1 = None
stepper2 = None
while True:
if keyboard.is_pressed('f') and not button... |
|
knoxvilles_joker |
General Coding Help |
7 |
3,242 |
Jun-13-2021, 09:18 PM |
|
|
Thread: Halting if command if gpio triggered event triggered
Post: RE: Halting if command if gpio triggered event tri...
(Jun-13-2021, 05:31 AM)bowlofred Wrote: What is the 200 loop for? Why not just move the stepper as long as a button is pressed and stop when it is released?
That is to back off the arm as it reache... |
|
knoxvilles_joker |
General Coding Help |
7 |
3,242 |
Jun-13-2021, 08:41 PM |
|
|
Thread: Halting if command if gpio triggered event triggered
Post: RE: Halting if command if gpio triggered event tri...
OK I did some playing around and apparently I have to add a nested if statement with a break that calls back to detech the button press on the relevant gpio pin.
if keyboard.is_pressed('f'):
kit.serv... |
|
knoxvilles_joker |
General Coding Help |
7 |
3,242 |
Jun-13-2021, 05:11 AM |
|
|
Thread: Halting if command if gpio triggered event triggered
Post: Halting if command if gpio triggered event trigger...
I am tweaking this code to get it ready for full integration into an animatronics costume setup. The individual pieces work. basically the GPIO triggers are limit switches. I am trying to build thi... |
|
knoxvilles_joker |
General Coding Help |
7 |
3,242 |
Jun-13-2021, 03:28 AM |
|
|
Thread: [split] [split] How to make a window stay on top
Post: RE: [split] [split] How to make a window stay on t...
I am still trying to get back into the mode. After dealing with a memorial service from my mother, a recent convention where I unveiled the predator costume I had been working on for the past year, a... |
|
knoxvilles_joker |
GUI |
10 |
6,186 |
May-22-2021, 03:54 AM |
|
|
Thread: drawing textvariable from Button inside canvas
Post: RE: drawing textvariable from Button inside canvas
deanhystad, thanks for your help on this. The text update methodology you exemplified is a great explanation. I am basically doing it, just a different way by employing a couple of method calls to g... |
|
knoxvilles_joker |
General Coding Help |
7 |
3,537 |
Apr-25-2021, 11:02 PM |
|
|
Thread: drawing textvariable from Button inside canvas
Post: RE: drawing textvariable from Button inside canvas
There was an option I was missing: lift().
I did this code and it works:
gun_1 = tk.Button(self, borderwidth=0,bg='black',fg='yellow',disabledforeground='yellow',state=tk.DISABLED,textvariab... |
|
knoxvilles_joker |
General Coding Help |
7 |
3,537 |
Apr-25-2021, 10:49 PM |
|
|
Thread: [split] [split] How to make a window stay on top
Post: RE: [split] [split] How to make a window stay on t...
As far as the example script I think that since classes are not being used the destroy functions do not work properly. In order for withdraw, destroy, deiconify calls to work properly class and metho... |
|
knoxvilles_joker |
GUI |
10 |
6,186 |
Apr-25-2021, 09:31 PM |
|
|
Thread: [split] [split] How to make a window stay on top
Post: RE: [split] [split] How to make a window stay on t...
I did more digging on this and the solution is to add this to the window frame declarations:
focus_force()
I added also focus_set() but that did not help
I add that to my original code and it appears... |
|
knoxvilles_joker |
GUI |
10 |
6,186 |
Apr-25-2021, 09:26 PM |
|
|
Thread: _tkinter.TclError: can't invoke "destroy" command: application has been destroyed
Post: RE: _tkinter.TclError: can't invoke "destroy" comm...
OK, I added root.focus_set() after defining the root window and the popup window after closing allows focus to remain on the main window and each child window.
root = tk.Tk ()
root.title ("Root Win... |
|
knoxvilles_joker |
GUI |
6 |
15,647 |
Apr-25-2021, 08:41 PM |
|
|
Thread: _tkinter.TclError: can't invoke "destroy" command: application has been destroyed
Post: RE: _tkinter.TclError: can't invoke "destroy" comm...
This is the button that was added to the desired popup window that closes it properly. Why that works, but calling a root.after 3 seconds to destroy it is beyond me.
text_entry = Button (toplevel_w... |
|
knoxvilles_joker |
GUI |
6 |
15,647 |
Apr-25-2021, 08:35 PM |
|
|
Thread: _tkinter.TclError: can't invoke "destroy" command: application has been destroyed
Post: RE: _tkinter.TclError: can't invoke "destroy" comm...
To deanhystad, I am using a provided solution by another member as a framework. the only thing I did was add a couple of windows so I have the number of windows to match what I am trying to do. The ... |
|
knoxvilles_joker |
GUI |
6 |
15,647 |
Apr-25-2021, 08:32 PM |
|
|
Thread: [split] [split] How to make a window stay on top
Post: RE: [split] [split] How to make a window stay on t...
The other question is can this be done with a class based setup, or does this have to stay as a function based setup in order for the calls to properly work with a window attribute of -topmost?
I fou... |
|
knoxvilles_joker |
GUI |
10 |
6,186 |
Apr-25-2021, 08:10 PM |
|
|
Thread: [split] [split] How to make a window stay on top
Post: RE: [split] [split] How to make a window stay on t...
Is there a good way to get a destroy mechanism used and a splashscreen of sorts for a loading screen used? I am still playing through things but it is proving to be a vexing problem. |
|
knoxvilles_joker |
GUI |
10 |
6,186 |
Apr-25-2021, 07:47 PM |
|
|
Thread: _tkinter.TclError: can't invoke "destroy" command: application has been destroyed
Post: RE: _tkinter.TclError: can't invoke "destroy" comm...
(Apr-25-2021, 08:53 AM)Yoriz Wrote: In the line
toplevel_windows.after(3000, toplevel_windows.destroy())you have called the destroy method by using () so it happens imediatly, the result of the meth... |
|
knoxvilles_joker |
GUI |
6 |
15,647 |
Apr-25-2021, 04:34 PM |
|
|
Thread: drawing textvariable from Button inside canvas
Post: RE: drawing textvariable from Button inside canvas
I am going through the code and I think I am already employing the methodology to which you are specifying.
the key bindings
self.bind("<KeyPress-a>", self.on_keypress_a)
self.bind("&l... |
|
knoxvilles_joker |
General Coding Help |
7 |
3,537 |
Apr-25-2021, 04:51 AM |
|
|
Thread: _tkinter.TclError: can't invoke "destroy" command: application has been destroyed
Post: _tkinter.TclError: can't invoke "destroy" command:...
Still sorting through how to make a splash window close automatically after application starts
I think it has to do with the way I have to format this line:
toplevel_windows.after(3000, toplevel_wind... |
|
knoxvilles_joker |
GUI |
6 |
15,647 |
Apr-25-2021, 03:34 AM |
|
|
Thread: drawing textvariable from Button inside canvas
Post: RE: drawing textvariable from Button inside canvas
(Apr-25-2021, 12:18 AM)deanhystad Wrote: This is a short example that demonstrates why you cannot do what you are trying to do.
import tkinter as tk
root = tk.Tk()
stringvar = tk.StringVar()
a = 'A... |
|
knoxvilles_joker |
General Coding Help |
7 |
3,537 |
Apr-25-2021, 02:48 AM |