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
Diff: main.cpp
- Revision:
- 2:769c937f9228
- Parent:
- 1:94681b7c2565
- Child:
- 3:7d014ee1c543
--- a/main.cpp Fri Apr 17 13:01:00 2015 +0000
+++ b/main.cpp Thu Apr 23 19:21:58 2015 +0000
@@ -25,6 +25,7 @@
AnalogIn Resp(A3);
AnalogIn Ppg(A4);
+
/*------CONTROLS THE DATA RATE OF THE READING------*/
Ticker t0;
Serial pc(USBTX,USBRX);
@@ -45,7 +46,7 @@
int main() {
pc.attach(&rx_Handler, pc.RxIrq);
-
+ t0.attach(&t0_handler,0.001); //deletar depois de implementar rxhandler baixar programa!!!!!
}
@@ -58,21 +59,27 @@
buffer[ECG1] = Ecg1.read_u16();
buffer[ECG2] = Ecg2.read_u16();
buffer[RESP] = Resp.read_u16();
- buffer[PPG] = Ppg.read_u16();
+ buffer[PPG] = Ppg.read_u16();
+ //Esses dados devem ser movidos e mandados o LSB e O MSB um de cada vez, o computador use estes dois dados;
+
+ //Não usar printf!!!
+ //Use putc instead!
+
pc.printf("%i,%i,%i,%i\n",buffer[ECG1],buffer[ECG2],buffer[RESP],buffer[PPG]);
}
//This function must
void rx_Handler(void){
- test = pc.getc(); // it gets the received character
- if (test=='s'|| test == 'S')
+ //Por enquanto estou sem programa que manda dados... ACHAR NOME PC DE CASA!!!
+ /* // test = pc.getc(); // it gets the received character
+ // if (test=='s'|| test == 'S')
{ // wake up routine
- t0.attach(&t0_handler,0.001); //start counting ----Data read in a 1kHz freq. (1mS)
+ // t0.attach(&t0_handler,0.001); //start counting ----Data read in a 1kHz freq. (1mS)
return;
}else if (test=='e'|| test == 'E')
{
t0.detach();
- }
+ }*/
}