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:
- 10:a8fcfc869fa5
- Parent:
- 7:0ac1f1ca8aa6
- Child:
- 11:a9f4237eaaa1
--- a/main.cpp Wed Apr 18 15:22:38 2018 +0000 +++ b/main.cpp Wed Apr 18 15:36:04 2018 +0000 @@ -11,8 +11,8 @@ DigitalOut myled3(LED3); Microphone mymicrophone(p16); - -int main() { +DigitalIn Button(p20); +void startup() { // The nRF24L01+ supports transfers from 1 to 32 bytes, but Sparkfun's // "Nordic Serial Interface Board" (http://www.sparkfun.com/products/9019) @@ -38,19 +38,10 @@ my_nrf24l01p.setReceiveMode(); my_nrf24l01p.enable(); +} -void michello() { - //read in, subtract 0.67 DC bias, take absolute value, and scale up .1Vpp to 15 for builtin LED display - myleds = int(abs((mymicrophone - (0.67/3.3)))*500.0); -//Use an 8kHz audio sample rate (phone quality audio); - wait(1.0/8000.0); - } - -void sendmic() { - whilte (1) - } -void pchello() { +void pctransmit() { // If we've received anything over the host serial link... if ( pc.readable() ) { @@ -67,7 +58,7 @@ } // Toggle LED1 (to help debug Host -> nRF24L01+ communication) - myled1 = !myled1; + myled3 = !myled3; } // If we've received anything in the nRF24L01+... @@ -87,14 +78,15 @@ } } } - -Mutex mux; -Thread pcthread; -Thread micthread; - while (1) { - - -} +void transmit() { + // while (mymycrophone.getData()) { + // txData[txDataCnt++] = mymicrophone.getData(); + // } + // txData[txDataCnt++] = ; + while (Button = 1) { + my_nrf24l01p.write(0, mymicrophone.getData(), txDataCnt); + } + } main (1) { while (1) {