Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie with Pi3
#28
Unfortunately I'm lost. I don't understand why it does not run as expected. To understand what I was trying read this

https://sourceforge.net/p/raspberry-gpio...ki/Inputs/

I posted it before. It describes the two different approaches to detecting change in pin - pooling and edge_detection. edge_detection has tow possible implementations - one is wait_for_edge and one is event_detect. event_detect on its turn has two possible implementations - one I try to use here and one with callback function which will run in separate thread.
The benefit of using event_detect is that it (supposedly) execute the code only once. In your original code you use pooling - it is running non-stop and sending commands to respective pin. e.g. stop motor even if it is already stopped. that is why it sends multiple sms. I was trying to use event detection, so stop motor for example is executed only once and thus allowing to send single sms at that moment.

The other link I posted yesterday from RPi forum is useful to explain multiple edge detections, but it looks a bit old and in RPio.GPIO package has this bouncetime property that is used to prevent event detection for some ms after first event.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Newbie with Pi3 - by Dualxeon - Mar-30-2018, 08:39 AM
RE: Newbie with Pi3 - by buran - Mar-30-2018, 09:32 AM
RE: Newbie with Pi3 - by Dualxeon - Mar-30-2018, 10:26 AM
RE: Newbie with Pi3 - by Dualxeon - Mar-30-2018, 10:19 PM
RE: Newbie with Pi3 - by snippsat - Mar-30-2018, 10:38 PM
RE: Newbie with Pi3 - by buran - Mar-31-2018, 05:53 AM
RE: Newbie with Pi3 - by Dualxeon - Mar-31-2018, 08:28 AM
RE: Newbie with Pi3 - by buran - Mar-31-2018, 08:48 AM
RE: Newbie with Pi3 - by Dualxeon - Mar-31-2018, 09:25 AM
RE: Newbie with Pi3 - by buran - Mar-31-2018, 10:00 AM
RE: Newbie with Pi3 - by Dualxeon - Mar-31-2018, 10:28 AM
RE: Newbie with Pi3 - by buran - Mar-31-2018, 10:47 AM
RE: Newbie with Pi3 - by Dualxeon - Mar-31-2018, 12:09 PM
RE: Newbie with Pi3 - by buran - Mar-31-2018, 12:23 PM
RE: Newbie with Pi3 - by buran - Mar-31-2018, 07:29 PM
RE: Newbie with Pi3 - by buran - Mar-31-2018, 07:47 PM
RE: Newbie with Pi3 - by Dualxeon - Mar-31-2018, 08:55 PM
RE: Newbie with Pi3 - by buran - Mar-31-2018, 09:13 PM
RE: Newbie with Pi3 - by Dualxeon - Apr-01-2018, 08:51 AM
RE: Newbie with Pi3 - by wavic - Apr-01-2018, 09:07 AM
RE: Newbie with Pi3 - by buran - Apr-01-2018, 08:57 AM
RE: Newbie with Pi3 - by buran - Apr-01-2018, 09:13 AM
RE: Newbie with Pi3 - by wavic - Apr-03-2018, 09:47 AM
RE: Newbie with Pi3 - by Dualxeon - Apr-01-2018, 09:14 AM
RE: Newbie with Pi3 - by buran - Apr-01-2018, 09:27 AM
RE: Newbie with Pi3 - by Dualxeon - Apr-01-2018, 09:36 AM
RE: Newbie with Pi3 - by buran - Apr-01-2018, 09:40 AM
RE: Newbie with Pi3 - by Dualxeon - Apr-01-2018, 11:34 AM
RE: Newbie with Pi3 - by buran - Apr-01-2018, 12:14 PM
RE: Newbie with Pi3 - by Dualxeon - Apr-01-2018, 06:32 PM
RE: Newbie with Pi3 - by buran - Apr-01-2018, 08:08 PM
RE: Newbie with Pi3 - by Dualxeon - Apr-02-2018, 10:19 AM
RE: Newbie with Pi3 - by buran - Apr-02-2018, 11:13 AM
RE: Newbie with Pi3 - by buran - Apr-02-2018, 11:20 AM
RE: Newbie with Pi3 - by Dualxeon - Apr-03-2018, 07:33 AM
RE: Newbie with Pi3 - by buran - Apr-03-2018, 07:41 AM
RE: Newbie with Pi3 - by Dualxeon - Apr-03-2018, 08:46 AM
RE: Newbie with Pi3 - by buran - Apr-03-2018, 08:56 AM
RE: Newbie with Pi3 - by buran - Apr-03-2018, 09:01 AM
RE: Newbie with Pi3 - by Dualxeon - Apr-03-2018, 09:17 AM
RE: Newbie with Pi3 - by buran - Apr-03-2018, 10:14 AM
RE: Newbie with Pi3 - by buran - Apr-03-2018, 11:04 AM
RE: Newbie with Pi3 - by Dualxeon - Apr-04-2018, 07:40 AM
RE: Newbie with Pi3 - by buran - Apr-04-2018, 08:02 AM
RE: Newbie with Pi3 - by Dualxeon - Apr-04-2018, 08:30 AM
RE: Newbie with Pi3 - by buran - Apr-04-2018, 09:08 AM
RE: Newbie with Pi3 - by Dualxeon - Apr-04-2018, 09:15 AM
RE: Newbie with Pi3 - by buran - Apr-04-2018, 09:22 AM
RE: Newbie with Pi3 - by Dualxeon - Apr-04-2018, 08:14 PM
RE: Newbie with Pi3 - by buran - Apr-04-2018, 08:21 PM
RE: Newbie with Pi3 - by Dualxeon - Apr-04-2018, 10:58 PM

Forum Jump:

User Panel Messages

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