diff options
author | bnewbold <bnewbold@ziggy.(none)> | 2009-09-28 21:52:42 -0400 |
---|---|---|
committer | bnewbold <bnewbold@ziggy.(none)> | 2009-09-28 21:52:42 -0400 |
commit | 05248cfda30b7f9f2f1d51dce3443deb97ae476b (patch) | |
tree | 3f2df979e4f89ae7a3bf671774499742e0111557 /src | |
parent | 0266ef7913c9817bd1c969dc7fe15809042128f0 (diff) | |
download | pysqrls-05248cfda30b7f9f2f1d51dce3443deb97ae476b.tar.gz pysqrls-05248cfda30b7f9f2f1d51dce3443deb97ae476b.zip |
PROG ROCK
Diffstat (limited to 'src')
-rw-r--r-- | src/jingle_bells/jingle_bells.pde | 4 | ||||
-rw-r--r-- | src/virtual_sqrl/virtual_sqrl.pde | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/jingle_bells/jingle_bells.pde b/src/jingle_bells/jingle_bells.pde index d4d49bf..c54bba8 100644 --- a/src/jingle_bells/jingle_bells.pde +++ b/src/jingle_bells/jingle_bells.pde @@ -4,7 +4,7 @@ */ #define LEDPIN 13 -#define OUTPIN 9 +#define OUTPIN 5 #define FREQ_A3 220.00 #define FREQ_AS3 233.08 @@ -113,6 +113,8 @@ void PlayMusicString(char* music, int outputPin){ void setup() { + TCCR1B = TCCR1B & 0b11111000 | 0x01; + analogWrite(9,12); } void loop() { //Jingle Bells translated from sheet music at diff --git a/src/virtual_sqrl/virtual_sqrl.pde b/src/virtual_sqrl/virtual_sqrl.pde index c7b7e47..62e7efa 100644 --- a/src/virtual_sqrl/virtual_sqrl.pde +++ b/src/virtual_sqrl/virtual_sqrl.pde @@ -35,7 +35,7 @@ void setup() { // Sets a starting volume analogWrite(volumePin,defaultVolume); - MsTimer2::set(10, handleLogic); // 10ms period + MsTimer2::set(1000, handleLogic); // 10ms period MsTimer2::start(); // interrupt 1 = pin 3 @@ -84,6 +84,14 @@ void handleLogic() { logicLock = 0; } +void chooseSpeaker() { + if(random(5) == 1) { + activeSpeaker = speakerTwoPin; + } else { + activeSpeaker = speakerOnePin; + } +} + void motionOn() { analogWrite(volumePin, 0); if(TSL>200) { |