Guest User

Untitled

a guest
Aug 4th, 2020
36
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. redPin = 11  
  2. greenPin = 13
  3. bluePin = 15
  4.  
  5. def turnOn(pin):
  6.     GPIO.setmode(GPIO.BOARD)
  7.     GPIO.setup(pin, GPIO.OUT)
  8.     GPIO.output(pin, GPIO.LOW)
  9.  
  10. def turnOff(pin):
  11.     GPIO.setmode(GPIO.BOARD)
  12.     GPIO.setup(pin, GPIO.OUT)
  13.     GPIO.output(pin, GPIO.HIGH)
  14.  
  15. def redOn():
  16.     turnOn(redPin)
  17.  
  18. def redOff():
  19.     turnOff(redPin)
  20.  
  21. def greenOn():
  22.     turnOn(greenPin)
  23.  
  24. def greenOff():
  25.     turnOff(greenPin)
  26.  
  27. def blueOn():
  28.     turnOn(bluePin)
  29.  
  30. def blueOff():
  31.     turnOff(bluePin)
  32.  
  33. def yellowOn():
  34.     turnOn(redPin)
  35.     turnOn(greenPin)
  36.  
  37. def yellowOff():
  38.     turnOff(redPin)
  39.     turnOff(greenPin)
  40.  
  41. def cyanOn():
  42.     turnOn(greenPin)
  43.     turnOn(bluePin)
  44.  
  45. def cyanOff():
  46.     turnOff(greenPin)
  47.     turnOff(bluePin)
  48.  
  49. def magentaOn():
  50.     turnOn(redPin)
  51.     turnOn(bluePin)
  52.  
  53. def magentaOff():
  54.     turnOff(redPin)
  55.     turnOff(bluePin)
  56.  
  57. def whiteOn():
  58.     turnOn(redPin)
  59.     turnOn(greenPin)
  60.     turnOn(bluePin)
  61.  
  62. def whiteOff():
  63.     turnOff(redPin)
  64.     turnOff(greenPin)
  65.     turnOff(bluePin)
RAW Paste Data