This commit is contained in:
Mikey Sklar 2017-10-06 12:44:53 -06:00
commit b6b33eb0d2
3 changed files with 35 additions and 1 deletions

View file

@ -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):

View file

@ -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

View file

@ -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