TP Info Indus Polytech paris sud Exemple de programme de base
Dependencies: FileSystem_POPS m3pi mbed
Fork of m3PI_TP_POPS_II2015v0 by
main3.cpp@3:b4b0c5219d2a, 2015-11-23 (annotated)
- Committer:
- bouaziz
- Date:
- Mon Nov 23 23:24:35 2015 +0000
- Revision:
- 3:b4b0c5219d2a
- Parent:
- 0:398afdd73d9e
programme de test pour le TP II; programme de base pour Polytech paris sud ; departement EES
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 | } |