Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: TextLCD mbed MMA8451Q TSI
main.cpp
- Committer:
- mfurlanetto
- Date:
- 2015-08-15
- Revision:
- 3:a703eda2b125
- Parent:
- 2:86de87ec731a
- Child:
- 4:f4bd9fe2200b
File content as of revision 3:a703eda2b125:
#include "mbed.h"
#include <Button.cpp>
#include "TextLCD.h"
#define DO4 262
#define RE4 294
#define MI4 330
#define FA4 349
#define SOL4 392
#define LA4 440
#define SI4 494
TextLCD lcd(PTE5, PTE3, PTE2, PTB11, PTB10, PTB9, TextLCD::LCD16x2); //TextLCD (PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7, LCDType type=LCD16x2, PinName bl=NC, PinName e2=NC, LCDCtrl ctrl=HD44780)
Speaker speaker (PTA4);
DigitalOut led1(LED1);
DigitalOut led2(LED2);
DigitalOut led3(LED3);
int freq =0;
int multiplier =1;
int main(){
led1=1;
led2=1;
led3=1;
Button a (PTA1, LA4, &freq, &multiplier);
Button b (PTA2, DO4, &freq, &multiplier);
Button c (PTA12, FA4, &freq, &multiplier);
lcd.cls();
while (true){
if(freq>0){
speaker.PlayNote(freq, 0.005, 0.2);
}
/* lcd.printf("%d", freq);
wait(0.1);
lcd.cls(); */
}
}
