Merge branch 'master' of https://github.com/adafruit/Adafruit_Learning_System_Guides
This commit is contained in:
commit
b6b33eb0d2
3 changed files with 35 additions and 1 deletions
|
|
@ -30,7 +30,7 @@ def cog(pos):
|
|||
#return (120, 0, 0, 0) #first color, red: for RGBW NeoPixels
|
||||
return (120, 0, 0) #first color, red: for RGB NeoPixels
|
||||
if (pos < 85):
|
||||
return (int(pos * 3), int(255 - (pos*3)), 0, 0)
|
||||
return (int(pos * 3), int(255 - (pos*3)), 0)
|
||||
#return (125, 35, 0, 0) #second color, brass: for RGBW NeoPixels
|
||||
return (125, 35, 0) #second color, brass: for RGB NeoPixels
|
||||
elif (pos < 170):
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
# CircuitPlaygroundExpress_Blinky
|
||||
|
||||
import digitalio
|
||||
import board
|
||||
import time
|
||||
|
||||
led = digitalio.DigitalInOut(board.D13) #defines the variable 'led'
|
||||
led.direction = digitalio.Direction.OUTPUT #set the pin as output
|
||||
|
||||
while True: #code below this point loops over and over
|
||||
led.value = True #turn on the LED
|
||||
time.sleep(0.5) #pause
|
||||
led.value = False #turn off the LED
|
||||
time.sleep(0.5) #pause
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# CircuitPlaygroundExpress_DigitalIO
|
||||
|
||||
from digitalio import DigitalInOut, Direction, Pull
|
||||
import board
|
||||
import time
|
||||
|
||||
led = DigitalInOut(board.D13)
|
||||
led.direction = Direction.OUTPUT
|
||||
|
||||
button = DigitalInOut(board.BUTTON_A) #button_a
|
||||
button.direction = Direction.INPUT
|
||||
button.pull = Pull.DOWN
|
||||
|
||||
while True:
|
||||
if button.value == True: #button is pushed
|
||||
led.value = True
|
||||
else:
|
||||
led.value = False
|
||||
|
||||
time.sleep(0.01) # debounce delay
|
||||
Loading…
Reference in a new issue