Buzzer example for mbed apps board or shield
Fork of IoTWorkshopLCD by
Diff: main.cpp
- Revision:
- 2:0e7e13c81df4
- Parent:
- 1:ac55ff7b1a7d
- Child:
- 3:abcecbc8c198
--- a/main.cpp Mon Feb 03 05:00:28 2014 +0000 +++ b/main.cpp Mon Feb 03 13:18:57 2014 +0000 @@ -2,21 +2,25 @@ #include "C027.h" #include "C12832_lcd.h" -//#define MBED_APPS_SHIELD -#define MBED_APPS_BOARD - -DigitalOut myled(LED1); +#define MBED_APPS_SHIELD +//#define MBED_APPS_BOARD #if defined(MBED_APPS_SHIELD) PwmOut spkr(D6); + DigitalOut myled(P3_25); + C12832_LCD lcd(D11, D13, D12, D7, D10); #elif defined(MBED_APPS_BOARD) PwmOut spkr(p26); + DigitalOut myled(LED1); #else #error application board not defined #endif int main() { + lcd.cls(); + lcd.locate(0.,3); + lcd.printf("Buzzer test!\n"); while(1) { for(int j=0; j<3; j++) { for (float i=2000.0; i<4000.0; i+=100) {