Appendix
Dependencies: HEPTA_SENSOR mbed HEPTA_EPS HEPTA_COM HEPTA_CDH
main.cpp@26:244a1b28d88b, 2019-08-27 (annotated)
- Committer:
- HeptaSatTraining2019
- Date:
- Tue Aug 27 03:52:39 2019 +0000
- Revision:
- 26:244a1b28d88b
- Parent:
- 25:5fd40a170032
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:bdbd3d6fc5d5 | 1 | #include "mbed.h" |
HeptaSatTraining2019 | 25:5fd40a170032 | 2 | #include "HEPTA_EPS.h" |
HeptaSatTraining2019 | 25:5fd40a170032 | 3 | #include "HEPTA_CDH.h" |
HeptaSatTraining2019 | 25:5fd40a170032 | 4 | #include "HEPTA_SENSOR.h" |
HeptaSatTraining2019 | 25:5fd40a170032 | 5 | #include "HEPTA_COM.h" |
umeume | 2:1c5cdb2c3e0f | 6 | |
umeume | 2:1c5cdb2c3e0f | 7 | Serial pc(USBTX,USBRX); |
HeptaSatTraining2019 | 21:92c25e853b87 | 8 | HEPTA_EPS eps(p16,p26); |
HeptaSatTraining2019 | 25:5fd40a170032 | 9 | HEPTA_CDH cdh(p5,p6,p7,p8,"sd"); |
HeptaSatTraining2019 | 26:244a1b28d88b | 10 | HEPTA_SENSOR sensor(p17, |
HeptaSatTraining2019 | 21:92c25e853b87 | 11 | p28,p27,0xD0,0x18, |
HeptaSatTraining2019 | 25:5fd40a170032 | 12 | p13,p14,p25,p24); |
HeptaSatTraining2019 | 21:92c25e853b87 | 13 | HEPTA_COM com(p9,p10); |
umeume | 2:1c5cdb2c3e0f | 14 | |
umeume | 2:1c5cdb2c3e0f | 15 | int main() |
umeume | 2:1c5cdb2c3e0f | 16 | { |
HeptaSatTraining2019 | 26:244a1b28d88b | 17 | FILE *dummy = fopen("/sd/dummy.txt","w"); |
HeptaSatTraining2019 | 26:244a1b28d88b | 18 | fclose(dummy); |
HeptaSatTraining2019 | 26:244a1b28d88b | 19 | pc.printf("Camera Snapshot Mode\r\n"); |
HeptaSatTraining2019 | 26:244a1b28d88b | 20 | pc.printf("Hit Any Key To Take Picture\r\n"); |
HeptaSatTraining2019 | 26:244a1b28d88b | 21 | while(!pc.readable()) {} |
HeptaSatTraining2019 | 26:244a1b28d88b | 22 | sensor.Sync(); |
HeptaSatTraining2019 | 26:244a1b28d88b | 23 | sensor.initialize(HeptaCamera_GPS::Baud115200, HeptaCamera_GPS::JpegResolution320x240); |
HeptaSatTraining2019 | 26:244a1b28d88b | 24 | sensor.test_jpeg_snapshot_data("/sd/test.txt"); |
HeptaSatTraining2019 | 26:244a1b28d88b | 25 | FILE *fp = fopen("/sd/test.txt", "r"); |
HeptaSatTraining2019 | 26:244a1b28d88b | 26 | if(fp == NULL) { |
HeptaSatTraining2019 | 26:244a1b28d88b | 27 | pc.printf("Could not open file for write\r\n"); |
HeptaSatTraining2019 | 26:244a1b28d88b | 28 | } else { |
HeptaSatTraining2019 | 26:244a1b28d88b | 29 | char str[1024]; |
HeptaSatTraining2019 | 26:244a1b28d88b | 30 | while((fgets(str,256,fp))!=NULL) { |
HeptaSatTraining2019 | 26:244a1b28d88b | 31 | pc.printf("%s",str); |
HeptaSatTraining2019 | 26:244a1b28d88b | 32 | //com.printf("%s",str); |
HeptaSatTraining2019 | 26:244a1b28d88b | 33 | wait(0.001); |
HeptaSatTraining2019 | 26:244a1b28d88b | 34 | } |
HeptaSatTraining2019 | 26:244a1b28d88b | 35 | fclose(fp); |
HeptaSatTraining2019 | 26:244a1b28d88b | 36 | } |
umeume | 2:1c5cdb2c3e0f | 37 | } |