cltp(仮), 日本語があるので修正必要。
Dependencies: mbed HEPTA_CDH_lite LPS25HB_I2C
main.cpp@2:e181e5c64233, 2021-08-20 (annotated)
- Committer:
- heptasat2021
- Date:
- Fri Aug 20 12:22:30 2021 +0000
- Revision:
- 2:e181e5c64233
- Parent:
- 1:ddac5ec89167
- Child:
- 3:f64ab3adcac5
For Hepta-Sat Lite
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
heptasat2021 | 0:da0f6aca15b8 | 1 | #include "mbed.h" |
heptasat2021 | 2:e181e5c64233 | 2 | #include "HEPTA_EPS.h" |
heptasat2021 | 1:ddac5ec89167 | 3 | #include "HEPTA_CDH.h" |
heptasat2021 | 1:ddac5ec89167 | 4 | HEPTA_CDH cdh(PB_5, PB_4, PB_3, PA_8, "sd"); |
heptasat2021 | 2:e181e5c64233 | 5 | HEPTA_EPS eps(PA_0,PA_4); |
heptasat2021 | 0:da0f6aca15b8 | 6 | Serial pc(USBTX,USBRX,9600); |
heptasat2021 | 0:da0f6aca15b8 | 7 | int main() |
heptasat2021 | 0:da0f6aca15b8 | 8 | { |
heptasat2021 | 2:e181e5c64233 | 9 | float btvol; |
heptasat2021 | 2:e181e5c64233 | 10 | char str[100]; |
heptasat2021 | 1:ddac5ec89167 | 11 | mkdir("/sd/mydir", 0777); |
heptasat2021 | 2:e181e5c64233 | 12 | FILE *fp = fopen("/sd/mydir/data.txt", "w"); |
heptasat2021 | 1:ddac5ec89167 | 13 | if(fp == NULL) { |
heptasat2021 | 1:ddac5ec89167 | 14 | error("Could not open file for write\r\n"); |
heptasat2021 | 0:da0f6aca15b8 | 15 | } |
heptasat2021 | 2:e181e5c64233 | 16 | for(int i=0;i<10;i++) { |
heptasat2021 | 2:e181e5c64233 | 17 | |
heptasat2021 | 2:e181e5c64233 | 18 | |
heptasat2021 | 2:e181e5c64233 | 19 | |
heptasat2021 | 2:e181e5c64233 | 20 | } |
heptasat2021 | 1:ddac5ec89167 | 21 | fclose(fp); |
heptasat2021 | 2:e181e5c64233 | 22 | fp = fopen("/sd/mydir/data.txt","r"); |
heptasat2021 | 2:e181e5c64233 | 23 | for(int i=0;i<10;i++) { |
heptasat2021 | 2:e181e5c64233 | 24 | |
heptasat2021 | 2:e181e5c64233 | 25 | |
heptasat2021 | 2:e181e5c64233 | 26 | } |
heptasat2021 | 2:e181e5c64233 | 27 | fclose(fp); |
heptasat2021 | 2:e181e5c64233 | 28 | pc.printf("Goodbye!\r\n"); |
heptasat2021 | 0:da0f6aca15b8 | 29 | } |