yuuki takiya
/
mbed_22
a
main.cpp
- Committer:
- ty0715
- Date:
- 2014-07-09
- Revision:
- 0:2b8a8135f8cf
File content as of revision 0:2b8a8135f8cf:
#include "mbed.h" #include "SCP1000.h" Serial xbee(p9,p10); Serial pc(USBTX, USBRX); SCP1000 scp1000(p5,p6,p7,p8); DigitalOut a(p19); AnalogIn UV(p20); PwmOut servo(p21); int main() { float temp; //char sv; a=0; //servo.period_us(32000); while(1) { temp=UV; //sv=xbee.getc(); //sv=xbee.getc(); //if(sv=='O'){ //servo=0.02; //printf("O\n"); // } //if(sv=='C'){ // servo=0.04; // printf("C\n"); // } printf("%8.2f#,",temp*3300); printf("%d@,%4.1f\n", scp1000.readPressure(), scp1000.readTemperature()); xbee.printf("$%8.2f#",temp*3300); xbee.printf("%d@%4.1f\n", scp1000.readPressure(), scp1000.readTemperature()); wait(0.5); } }