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: mbed 4DGL-uLCD-SE mbed-rtos nRF24L01P
Diff: main.cpp
- Revision:
- 2:dc046ff72566
- Parent:
- 1:fc0a2c17e086
- Child:
- 7:0ac1f1ca8aa6
- Child:
- 9:268d096562f1
--- a/main.cpp Wed Apr 18 14:35:32 2018 +0000 +++ b/main.cpp Wed Apr 18 14:40:57 2018 +0000 @@ -1,35 +1,18 @@ #include "mbed.h" +#include "Microphone.h" #include "nRF24L01P.h" #include "rtos.h" + + Serial pc(USBTX, USBRX); // tx, rx nRF24L01P my_nrf24l01p(p5, p6, p7, p8, p9, p10); // mosi, miso, sck, csn, ce, irq DigitalOut myled1(LED1); DigitalOut myled2(LED2); DigitalOut myled3(LED3); -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); +Microphone mymicrophone(p16); int main() {