Skip to content

Instantly share code, notes, and snippets.

@vieskees
Created June 1, 2020 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vieskees/83b1af5142950b65f9949e45ddd22ddc to your computer and use it in GitHub Desktop.
Save vieskees/83b1af5142950b65f9949e45ddd22ddc to your computer and use it in GitHub Desktop.
Test script for MOSFET control with GPIO
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)
def turnon():
GPIO.output(11,True)
def turnoff():
GPIO.output(11,False)
turnon()
time.sleep(5)
turnoff()
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment