From: Limor "Ladyada" Fried Date: Thu, 18 Oct 2018 16:40:16 +0000 (-0700) Subject: Merge pull request #40 from pdp7/master X-Git-Tag: 0.3.0~2 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/5726b6f83a991f3c957f4b6800bf1ee6d44c9845?hp=faaf4b81a82db9e8b87fa23e6cd4040bd6dbde24 Merge pull request #40 from pdp7/master Add example to blink LED on BeagleBone --- diff --git a/examples/bbb_digitalio.py b/examples/bbb_digitalio.py new file mode 100644 index 0000000..25496d5 --- /dev/null +++ b/examples/bbb_digitalio.py @@ -0,0 +1,22 @@ +# Example of blinking LED on BeagleBone Black +# https://www.adafruit.com/product/1876 +# +# Wire the circuit as follows: +# 1) connect anode (+) lead of LED to P9.12 pin +# 2) connect cathode (-) lead to 1K Ohm resistor +# 3) connect that 1K Ohm resistor to DGND (P9.1) + +import time +import board +import digitalio + +print("hello blinky!") + +led = digitalio.DigitalInOut(board.P9_12) +led.direction = digitalio.Direction.OUTPUT + +while True: + led.value = True + time.sleep(0.5) + led.value = False + time.sleep(0.5)