![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ECE 4180 Final Project MP3 player code
Dependencies: mbed mbed-rtos wave_player_appbd 4DGL-uLCD-SE SDFileSystem PinDetect
main.cpp
- Committer:
- lfink6
- Date:
- 2021-12-08
- Revision:
- 0:57a32b7102e8
- Child:
- 1:481169ca05e0
File content as of revision 0:57a32b7102e8:
#include "mbed.h" #include "rtos.h" #include "SDFileSystem.h" #include "uLCD_4DGL.h" #include "wave_player.h" #include "LSM9DS1.h" DigitalOut myled(LED1); Serial blue(p28,p27); uLCD_4DGL uLCD(p13,p14,p11); SDFileSystem sd(p5, p6, p7, p8, "sd"); LSM9DS1 imu(p9, p10, 0xD6, 0x3C); class microphone { public : microphone(PinName pin); float read(); operator float (); private : AnalogIn _pin; }; microphone::microphone (PinName pin): _pin(pin) { } float microphone::read() { return _pin.read(); } inline microphone::operator float () { return _pin.read(); } microphone mymicrophone(p16); int main() { imu.begin(); if (!imu.begin()) { //set fail flag for imu here } imu.calibrate(); while(1) { myled = 1; wait(0.2); myled = 0; wait(0.2); } }