Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Start Mode: When the mystery box is reset it goes into Start Mode. Start mode ends if a touch is detected on the Cap Sense pad. A brief animation on the seven segment LED will indicate that the Cap Sense pad was touched. The mystery box will then go into Code Entry Mode.
- Code Entry Mode: Once the mystery box is in Code Entry Mode, the user can use the sliders and the buttons below them to enter a three digit code.
- Holding the button below a slider will cause a number between 0 and 9 to show on the seven segment display corresponding to the slider's position.
- When a button is released, a variable will remember a guess based on the last number shown while the button was being held.
- When no buttons are being held, the seven segment display will show nothing.
- If the three guess variables match the three digits in the code, then the mystery box will go into Success Mode.
- Success Mode: When the correct code has been entered and recognized in code entry mode, success mode will reveal the mystery box's secret.
- Use a for loop to play the song stored in the endSongNotes and endSongTimes arrays. The notes are frequencies (except as noted below) and the times are milliseconds.
- if a note is equal to zero, then you should turn off the buzzer and wait for the corresponding time
- otherwise start playing the indicated frequency on the buzzer and wait for the corresponding time
- When the song is done, reset the guess and switch back to Start Mode.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement