This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
SparkFun Inventor's Kit | |
Example sketch 16 | |
SIMON SAYS | |
Simon Says is a memory game. Start the game by pressing one of the four buttons. When a button lights up, | |
press the button, repeating the sequence. The sequence will get longer and longer. The game is won after | |
13 rounds. | |
Generates random sequence, plays music, and displays button lights. | |
Simon tones from Wikipedia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//time the interval lengths | |
unsigned long prevMillis = 0; | |
unsigned long prevMillisButtonCheck = 0; | |
unsigned long prevMillisLEDCheck = 0; | |
unsigned long currentMillis; | |
//checks if button has been hit, | |
//if analogRead(button) exceeds the threshold | |
boolean buttonCheck = false; | |
int threshold = 500; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Common Algorithms*/ | |
/* | |
i = x + (y * width) | |
//Index of Grid = X coordinate * (Y coordinate * width) | |
Math.floor(Math.random() + 0.5) | |
//Randomly chooses between 0 and 1 | |
*/ | |
window.onload = function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
#### # #### ##### ## # #### | |
# # # # # # # # # # # | |
# # # # ##### # # # #### | |
# ### # # # # # ###### # # | |
# # # # # # # # # # # # | |
#### ###### #### ##### # # ###### #### | |
*/ | |
//pressure on pad where hit is registered | |
int hitThreshold = 780; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int centerPad = A0; | |
int rightPad = A1; | |
int bottomPad = A3; | |
int leftPad = A5; | |
int centerLED = 2; | |
int rightLED = 3; | |
int bottomLED = 4; | |
int leftLED = 7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int centerPad = A0; | |
int rightPad = A1; | |
int bottomPad = A3; | |
int leftPad = A5; | |
int centerLED = 2; | |
int rightLED = 3; | |
int bottomLED = 4; | |
int leftLED = 7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Common Algorithms*/ | |
/* | |
i = x + (y * width) | |
//Index of Grid = X coordinate * (Y coordinate * width) | |
Math.floor(Math.random() + 0.5) | |
//Randomly chooses between 0 and 1 | |
*/ | |
function Grid(x,y){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bugs found in ubuntu mate beta: | |
Firfox can freeze system if downloading compressed file and opening containing folder from downloads button menu in firefox | |
-can only right click the shutdown button in top right menu bar | |
-sometimes can not select an option in the shutdown menu | |
-accessing from the all-downloads window also frozen firefox | |
Independant of firefox, sometimes you can only right click the shutdown button on the menu bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*This sketch is a simple version of the famous Simon Says game. You can use it and improved it adding | |
levels and everything you want to increase the diffuculty! | |
There are five buttons connected to A0, A1, A2, A3 and A4. | |
The buttons from A0 to A3 are used to insert the right sequence while A4 to start the game. | |
When a wrong sequence is inserted all the leds will blink for three time very fast otherwhise the | |
inserted sequence is correct. | |
Hardware needed: |
NewerOlder