Skip to content

Fixed GPIO export problem; Leaves GPIO in bad state on latest BeagleB… #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2018

Conversation

erikwelsh
Copy link
Contributor

This pull request fixes issue #281

This is a quick copy of the LED detection code from gpio_set_direction into the gpio_export() function.

@pdp7
Copy link
Collaborator

pdp7 commented Oct 2, 2018

@erikwelsh thanks for creating this PR.

I will test this out and merge if no issues.

@pdp7 pdp7 self-assigned this Oct 2, 2018
@pdp7
Copy link
Collaborator

pdp7 commented Oct 7, 2018

I was able to test this successfully on BeagleBone Blue and turn on and off all 4 USR LEDs, in addition to the other built-in LEDs.

import Adafruit_BBIO.GPIO as GPIO
import time

# test built in LEDs on BeagleBone Blue
LED =  [ "USR0" , "USR1", "USR2", "USR3", "RED_LED", "GREEN_LED", "BAT25", "BAT50", "BAT75", "BAT100", "WIFI" ]

for i in LED:
	print("{0}: setup".format(i))
	GPIO.setup(i, GPIO.OUT)

while True:
	for i in LED:
		print("{0}: on".format(i))
		GPIO.output(i, GPIO.HIGH)
		time.sleep(0.5)
		print("{0}: off".format(i))
		GPIO.output(i, GPIO.LOW)
		time.sleep(0.5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy