PulseSensor1

Dependencies:   mbed USBDevice

main.cpp

Committer:
the_nabil
Date:
2020-01-21
Revision:
1:37f0b3e46b9e

File content as of revision 1:37f0b3e46b9e:

#include "mbed.h"
#include "PulseSensor.h"

 
//USBSerial pc;
AnalogIn analog_value(A1); 
float meas;   

/** Print the data in a format that can be parsed by the 
 *  Processing application available here: http://pulsesensor.myshopify.com/pages/code-and-guide
*/
void sendDataToProcessing(char symbol, int data)
{
    //pc.printf("%c%d\r\n", symbol, data);
    
}

 
 
 
int main() {
    
    
    PulseSensor sensor(A1, sendDataToProcessing);
    /*
    //pc.baud(115200);
    
    sensor.start();
    */
 
    while(1) {
        sensor.start();
        /*
        meas = 3300 * analog_value.read();
        pc.printf("Signal = %f\n", meas);
        */
        
        wait(0.5);
        
    }
}