Final version of Polulu M2 SETI
Dependencies: FileSystem_POPS m3PI_TP_POPS_II2015v0 m3pi mbed
Fork of m3PI_TP_POPS_II2015v0 by
main3.cpp@0:398afdd73d9e, 2015-11-23 (annotated)
- Committer:
- bouaziz
- Date:
- Mon Nov 23 22:58:34 2015 +0000
- Revision:
- 0:398afdd73d9e
- Child:
- 4:cdd8e61cd8c7
program example for II labs of Polytech paris Sud EES department.; exemple de base pou rle TP de II
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bouaziz | 0:398afdd73d9e | 1 | |
bouaziz | 0:398afdd73d9e | 2 | #include "mbed.h" |
bouaziz | 0:398afdd73d9e | 3 | #include "m3pi.h" |
bouaziz | 0:398afdd73d9e | 4 | #include "MSCFileSystem.h" |
bouaziz | 0:398afdd73d9e | 5 | |
bouaziz | 0:398afdd73d9e | 6 | m3pi m3pi; // Initialise the m3pi |
bouaziz | 0:398afdd73d9e | 7 | |
bouaziz | 0:398afdd73d9e | 8 | Serial xbee(p28,p27); |
bouaziz | 0:398afdd73d9e | 9 | DigitalOut resetxbee(p26); |
bouaziz | 0:398afdd73d9e | 10 | Serial pc(USBTX, USBRX); // For debugging and pc messages, uses commented out to prevent hanging |
bouaziz | 0:398afdd73d9e | 11 | MSCFileSystem fs("fs"); |
bouaziz | 0:398afdd73d9e | 12 | |
bouaziz | 0:398afdd73d9e | 13 | BusOut myleds(LED1, LED2, LED3, LED4); |
bouaziz | 0:398afdd73d9e | 14 | |
bouaziz | 0:398afdd73d9e | 15 | int main() { |
bouaziz | 0:398afdd73d9e | 16 | resetxbee =0; |
bouaziz | 0:398afdd73d9e | 17 | wait(0.01); |
bouaziz | 0:398afdd73d9e | 18 | resetxbee =1; |
bouaziz | 0:398afdd73d9e | 19 | |
bouaziz | 0:398afdd73d9e | 20 | FILE *p= fopen("/fs/tt.txt","a+"); |
bouaziz | 0:398afdd73d9e | 21 | m3pi.sensor_auto_calibrate(); |
bouaziz | 0:398afdd73d9e | 22 | wait(1.); |
bouaziz | 0:398afdd73d9e | 23 | |
bouaziz | 0:398afdd73d9e | 24 | fprintf(p,"ecrire dans la cle USB\r\n"); |
bouaziz | 0:398afdd73d9e | 25 | fclose(p); |
bouaziz | 0:398afdd73d9e | 26 | |
bouaziz | 0:398afdd73d9e | 27 | while(1) { |
bouaziz | 0:398afdd73d9e | 28 | |
bouaziz | 0:398afdd73d9e | 29 | |
bouaziz | 0:398afdd73d9e | 30 | } |
bouaziz | 0:398afdd73d9e | 31 | } |