• The NeoPixel leds need to be initialized so we can use them later when we program the the different colors and modes. This is where the brightness of the pixels is set but we can change the value from the top of the program because we made a variable for it!
#determine brightness (Value can be between 0 and 1)
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=pixelBrightness)
The NeoPixels on the Circuit Playground Express
  • Next we initialize the buttons on the board by creating two variables, one for each button, and declaring each button as an input. One will be for moving down pitches (buttonD), one for moving up pitches (buttonU).
buttonD = DigitalInOut(board.BUTTON_A) #button a is the down button
buttonD.direction = Direction.INPUT
buttonD.pull = Pull.DOWN
buttonU = DigitalInOut(board.BUTTON_B) # button b is the up button
buttonU.direction = Direction.INPUT
buttonU.pull = Pull.DOWN
The buttons on the Circuit Playground Express
  • Next we initialize the speaker on the board and declare it as an output.
spkrenable = DigitalInOut(board.SPEAKER_ENABLE)
spkrenable.direction = Direction.OUTPUT
spkrenable.value = True 
The speaker on the Circuit Playground Express

This guide was first published on Mar 28, 2018. It was last updated on Mar 28, 2018.

This page (NeoPixels, Buttons and Speaker set up) was last updated on Mar 25, 2018.

Text editor powered by tinymce.