Beagle Board - beagleboard.org
Mala Dies
Published

N-Channel MOSFET, BBB, and LEDs

Did you ever want to use a FET for switching your LED on and off?

BeginnerProtip1 hour57
N-Channel MOSFET, BBB, and LEDs

Things used in this project

Hardware components

BeagleBone Black
BeagleBoard.org BeagleBone Black
×1
Logic Level FET N-Channel
Logic Level FET N-Channel
×1
LED (generic)
LED (generic)
×1
Resistor 221 ohm
Resistor 221 ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Python
Adafruit_BBIO.GPIO

Story

Read more

Schematics

Image of the Circuit

N-Channel MOSFET

BBB!

Photo and Pinout!

Code

Simple and Concise!

Python
Here it is!
import Adafruit_BBIO.GPIO as GPIO
import time

LED = "P9_12"
GPIO.setup(LED, GPIO.OUT)

while True:
    GPIO.output(LED, GPIO.HIGH)
    time.sleep(5) # this keeps it on for five seconds!
    
    GPIO.output(LED, GPIO.LOW)
    time.sleep(5) # off for five seconds 
    
    # repeats until canceled!

Credits

Mala Dies

Mala Dies

5 projects • 1 follower
Stay there and someone will find you...

Comments

Add projectSign up / Login