Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. 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.
  2.  
  3. 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.
  4. 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.
  5. When a button is released, a variable will remember a guess based on the last number shown while the button was being held.
  6. When no buttons are being held, the seven segment display will show nothing.
  7. If the three guess variables match the three digits in the code, then the mystery box will go into Success Mode.
  8.  
  9. Success Mode: When the correct code has been entered and recognized in code entry mode, success mode will reveal the mystery box's secret.
  10. 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.
  11. if a note is equal to zero, then you should turn off the buzzer and wait for the corresponding time
  12. otherwise start playing the indicated frequency on the buzzer and wait for the corresponding time
  13. When the song is done, reset the guess and switch back to Start Mode.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement