Python Forum
Seemingly unstable GPIO output while executing from RetroPie
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Seemingly unstable GPIO output while executing from RetroPie
#4
Yes, that does it! The lights blinked on and off after the PWM.

Experimenting, trying to minimize, and fine-tuning:
-It had to go through (1) off and (1) on cycle in order to work; it would not work just going directly to "on".
-One cycle is needed, and there had to be a minimum pause (sleep) of 0.01 seconds after "off"; omitting any pause after "on" retained functionality.

Here is what I reduced it to:
for _ in range(1):
    GPIO.output(11, GPIO.LOW)
    sleep(0.01)
    GPIO.output(11, GPIO.HIGH)
I apologize for the inconsistencies in the comments; it makes for nonsense. They originally came from a tutorial, and the differences were from tweaking. I was pre-occupied with forum format and wondering why the straight forward logic of the code wasn't operating as intended.

Thanks, deanhystad!


It's interesting, now that I've got this under control, I can see how and why PWM does not always give smooth dimming effect at very low cycle duty - the "flicker" is so slow that it is somewhat discernable rocky blips (at least, a subliminal mess at startup). Additionally, there is occasional haphazard loop steps. Oh well, that's another issue for another time.
Reply


Messages In This Thread
RE: Seemingly unstable GPIO output while executing from RetroPie - by LouF - Feb-18-2021, 01:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  why does VS want to install seemingly unrelated products? db042190 3 694 Jun-12-2023, 02:47 PM
Last Post: deanhystad
  function return boolean based on GPIO pin reading caslor 2 1,234 Feb-04-2023, 12:30 PM
Last Post: caslor
  class Update input (Gpio pin raspberry pi) caslor 2 850 Jan-30-2023, 08:05 PM
Last Post: caslor
  Webhook, post_data, GPIO partial changes DigitalID 2 1,040 Nov-10-2022, 09:50 PM
Last Post: deanhystad
  Pexpect timesout before executing whole output eagerissac 0 1,539 Jun-23-2021, 03:30 AM
Last Post: eagerissac
  Seemingly simple loop Weber585 7 3,587 Mar-21-2021, 07:19 PM
Last Post: jefsummers
  Picture changing triggered by GPIO q_nerk 2 2,623 Dec-14-2020, 03:32 PM
Last Post: DeaD_EyE
  GPIO high if network IP has good ping duckredbeard 3 2,392 Oct-12-2020, 10:41 PM
Last Post: bowlofred
  raspberry pi tank gpio help jatgm1 1 2,447 May-06-2020, 09:00 PM
Last Post: Larz60+
  Where should I place GPIO.cleanup() shallanq 2 2,216 Apr-11-2020, 05:02 AM
Last Post: shallanq

Forum Jump:

User Panel Messages

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