natsu tsumagari
/
test_cadenceClass
回転数計のクラスです。
main.cpp@2:b492f029a2f4, 2016-11-23 (annotated)
- Committer:
- tsumagari
- Date:
- Wed Nov 23 06:06:29 2016 +0000
- Revision:
- 2:b492f029a2f4
- Parent:
- 1:6bceac3446ff
- Child:
- 3:0986b5d80ded
????substr???????????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tsumagari | 0:57308daf8dfe | 1 | #include "mbed.h" |
tsumagari | 1:6bceac3446ff | 2 | #include "Cadence.h" |
tsumagari | 1:6bceac3446ff | 3 | //#include <string> |
tsumagari | 0:57308daf8dfe | 4 | |
tsumagari | 0:57308daf8dfe | 5 | DigitalOut myled(LED1); |
tsumagari | 0:57308daf8dfe | 6 | Ticker cadenceTicker; |
tsumagari | 0:57308daf8dfe | 7 | Serial pc(USBTX,USBRX); //for debug |
tsumagari | 0:57308daf8dfe | 8 | |
tsumagari | 0:57308daf8dfe | 9 | Cadence cadence(p13,p14); |
tsumagari | 0:57308daf8dfe | 10 | |
tsumagari | 0:57308daf8dfe | 11 | int main() { |
tsumagari | 0:57308daf8dfe | 12 | pc.baud(115200); |
tsumagari | 0:57308daf8dfe | 13 | while(1) { |
tsumagari | 0:57308daf8dfe | 14 | myled = 1; |
tsumagari | 0:57308daf8dfe | 15 | wait(0.2); |
tsumagari | 0:57308daf8dfe | 16 | myled = 0; |
tsumagari | 0:57308daf8dfe | 17 | wait(0.2); |
tsumagari | 0:57308daf8dfe | 18 | pc.printf("test\n\r"); |
tsumagari | 0:57308daf8dfe | 19 | pc.printf("cadence: %f\n\r",cadence.cadence); |
tsumagari | 2:b492f029a2f4 | 20 | pc.printf("%s\n\r",cadence.strC); |
tsumagari | 0:57308daf8dfe | 21 | pc.printf("voltage: %f\n\r",cadence.cadenceV); |
tsumagari | 2:b492f029a2f4 | 22 | cadence.readData(); |
tsumagari | 2:b492f029a2f4 | 23 | pc.printf("'%c!\n\r",cadence.strData[0]); |
tsumagari | 0:57308daf8dfe | 24 | } |
tsumagari | 0:57308daf8dfe | 25 | } |