Repository navigation
5. Challenges
At its core, programming is the process of breaking down a problem into smaller steps. So far those steps have been laid out, but now the exercises will be more free form. If you don't feel comfortable with the code on the previous pages, I would suggest you head back and experiment-- Think of something unique you could do with the neopixels and play around.
Here is a list of exercises you can work on to flex your new programming muscles. Feel free to skip some or do them in any order you like. Of course, if you have an idea for something not on this list, feel free to work on that instead-- experimentation is a great way to learn! If you need help; look back at the previous examples, check the Java library documentation, or ask a teammate. If you are really stuck, ask a mentor.
- Play 2 different tones when pressing the two different buttons.
- Did you play a tone for a specific time? Or turn it off when you let go of the button?
- Did you create a function that played the tone? Did you need to?
- Play a different tone for every one of the touch pads.
- Store several notes in an array, and use a loop to play all of them.
- You can learn about arrays here, which are a common data structure we use in programming.
- Listen for a noise, and play a tone or turn on a pixel if the noise is too loud.
- Change the color of the neopixels based on the temperature.
- You can show set temperature ranges, or a continuous change of colors.
- Create a round thermometer showing cold to hot by number of pixels shown.
- Measure the light level. Cover the sensor with your hand to see the changes.
- Print the current level to the console.
- Play a tone based on the light level
- Show less pixels on if the light is low, more if it is bright
- Use the accelerometer.
- Change the tone played depending on the angle of the board left to right.
- Change the pixel displayed based on the angle of the board in both left to right and forward and back.
- Create the game of Simon.
- The board will show random lights, the user will then need to touch the right touch pads to continue
- Can you make the game get harder by increasing the speed or number of lights shown?
- Or something else entirely... What do you want to make?