Home > other >  Events trigger structure questions about python?
Events trigger structure questions about python?

Time:09-23

Everybody is good!
Recently in written in raspberries to send a remote control car control program, drive motor to use PWM function of GPIO,
There are
 
ENA=13 # # GPIO pin
Freq=500 # PWM transmission frequency
PWM=GPIO. PWM (ENA, freq)
PWM. The stop ()

Used to make can launch square wave, and banned GPIO port due to the time order in the running process need to be performed only once, so I want to do it in a variable to trigger this command,
In other words, suppose you have variable a:
Execute when the variables from False to True, a PWM=GPIO. PWM (ENA, freq) at a time;
When the variables a from True to False, perform PWM. Stop (once),

Before used Pyqt framework, can achieve this kind of operation in the front-end interface, but there is no interface, the control program is how to realize such functions, or what framework can be used?
For advice modestly, thank you!
  • Related