![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ECE 4180 Final
Dependencies: mbed wave_player mbed-rtos C12832_lcd 4DGL-uLCD-SE LCD_fonts SDFileSystem
Diff: main.cpp
- Revision:
- 16:13b65f6139be
- Parent:
- 14:6f5432bb44c0
- Child:
- 17:13e45fdcf0b0
diff -r 6f5432bb44c0 -r 13b65f6139be main.cpp --- a/main.cpp Thu Dec 05 20:30:25 2019 +0000 +++ b/main.cpp Fri Dec 06 03:10:34 2019 +0000 @@ -3,6 +3,7 @@ #include "SDFileSystem.h" #include "wave_player.h" #include "uLCD_4DGL.h" +#include "mpr121.h" //setup some color objects in flash using const's @@ -37,6 +38,22 @@ DigitalIn pb1(p20); DigitalIn pb2(p19); AnalogOut DACout(p18); +// Create the interrupt receiver object on pin 26 for touch pad IRQ +InterruptIn interrupt(p26); +// Setup the i2c bus on pins 9 and 10 +I2C i2c(p9, p10); +// Setup the Mpr121: +// constructor(i2c object, i2c address of the mpr121) +Mpr121 mpr121(&i2c, Mpr121::ADD_VSS); + +// Key hit/release interrupt routine +void fallInterrupt() { + int key_code=0; + int i=0; + int value=mpr121.read(0x00); + value +=mpr121.read(0x01)<<8; +} + wave_player waver(&DACout); Thread thread1, thread2, thread3; Ticker nextsample;