Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbedTimer SDFileSystem MU2 GPS
main.cpp
- Committer:
- Nerosho
- Date:
- 2019-07-30
- Revision:
- 1:a8772ca26d1b
- Parent:
- 0:d0f3991839ec
- Child:
- 2:d6dc5c2224cc
File content as of revision 1:a8772ca26d1b:
#include "mbed.h"
#include "MU2.h"
#include "SDFileSystem.h"
#include "GPS.h"
MU2 MuPort(p9,p10);
SDFileSystem sd(p5, p6, p7, p8, "sd");
GPS gps(p13,p14);
DigitalIn flight(p21); //フライトピン
DigitalOut FIRE(p26); //溶断
DigitalOut myled(LED1);
DigitalOut myled3(LED3);
DigitalOut myled4(LED4);
int main()
{
//Serial pc(USBTX,USBRX);
//pc.baud(9600);
wait(3);
//FILE* fp1=fopen("/sd/cansat/log1.txt", "w");
FILE* fp2;
//fprintf(fp1, "cansat start\r\n");
while(1) { //溶断機構
if (flight==1) {
wait(2);
}
else {
//FIRE=1;
myled=1;
wait(20);
FIRE=0;
myled=0;
break;
}
}
while(1) {
//MuPort.send(testmessage);
if(gps.getGPGGA()) {
MuPort.send(gps.GPSMessage);
//pc.printf("%s\r\n",gps.GPSMessage);
fp2 = fopen("/sd/cansat/gpsdata3.csv", "w");//FILEポインタの宣言
//myled3=1;
if(fp2 == NULL) {
error("Could not open file for write\n");
//myled4=1;
}
fprintf(fp2, "%s\n", gps.GPSMessage);
fclose(fp2);
}
wait(1);
}
}