Whack a Mole game! Features: - LCD graphics display - Touch pad input - Speaker effects through a class D audio amplifier\ - A high score page maintained by the SD card file system - Analog noise used to seed random numbers
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed
Fork of MPR121_Demo by
Revision 6:ca03b9c94c88, committed 2016-03-14
- Comitter:
- tpettet3
- Date:
- Mon Mar 14 05:43:51 2016 +0000
- Parent:
- 5:070755be0a77
- Child:
- 7:5a8f9a018e1f
- Commit message:
- Working with sound. Still has multiple tap
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Mar 14 05:36:09 2016 +0000
+++ b/main.cpp Mon Mar 14 05:43:51 2016 +0000
@@ -35,6 +35,7 @@
DigitalOut led4(LED4);
AnalogIn Ain(p15);
+SongPlayer mySpeaker(p21);
// Create the interrupt receiver object on pin 26
InterruptIn interrupt(p26);
// Setup the Serial to the PC for debugging
@@ -70,26 +71,32 @@
// LED demo mod by J. Hamblen
if (value==256&&pos1==1)
{
+ mySpeaker.PlaySong(note,duration);
score++;
}
if (value==16&&pos2==1)
{
+ mySpeaker.PlaySong(note,duration);
score++;
}
if (value==1&&pos3==1)
- {
+ {
+ mySpeaker.PlaySong(note,duration);
score++;
}
if (value==512&&pos4==1)
{
+ mySpeaker.PlaySong(note,duration);
score++;
}
if (value==32&&pos5==1)
{
+ mySpeaker.PlaySong(note,duration);
score++;
}
if (value==2&&pos6==1)
{
+ mySpeaker.PlaySong(note,duration);
score++;
}
pc.printf("MPR value: %x \r\n", value);
