回転数計のクラスです。

Dependencies:   mbed

main.cpp

Committer:
tsumagari
Date:
2016-11-23
Revision:
3:0986b5d80ded
Parent:
2:b492f029a2f4
Child:
4:2def7f5f7fed

File content as of revision 3:0986b5d80ded:

#include "mbed.h"
#include "Cadence.h"
//#include <string>

DigitalOut myled(LED1);
Ticker cadenceTicker;
Serial pc(USBTX,USBRX); //for debug

Cadence cadence(p13,p14);

int main() {
    pc.baud(115200);
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
        pc.printf("test\n\r");
        pc.printf("cadence: %f\n\r",cadence.cadence);
        pc.printf("%s\n\r",cadence.strC);
        pc.printf("voltage: %f\n\r",cadence.cadenceV);
        cadence.readData();
        pc.printf("'%c!\n\r",cadence.strData[0]);
    }
}