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: HEPTA_SENSOR Grove_Air_Quality_Sensor_Library mbed HEPTA_EPS HEPTA_COM HEPTA_CDH
Diff: main.cpp
- Revision:
- 30:f300d1e88f4c
- Parent:
- 29:eb84063fe5c9
- Child:
- 32:c22cbcfb4635
diff -r eb84063fe5c9 -r f300d1e88f4c main.cpp
--- a/main.cpp Sun Nov 21 02:23:58 2021 +0000
+++ b/main.cpp Fri Dec 03 11:09:33 2021 +0000
@@ -13,25 +13,6 @@
Serial sat(USBTX,USBRX,9600);
Timer sattime;
int rcmd = 0,cmdflag = 0; //command variable
-
-//getting command and flag
-void commandget()
-{
- rcmd=com.getc();
- cmdflag = 1;
-}
-//interrupting
-void receive(int rcmd, int cmdflag)
-{
- com.xbee.attach(commandget,Serial::RxIrq);
-}
-//initialzing
-void initialize()
-{
- rcmd = 0;
- cmdflag = 0;
- condition = 0;
-}
int main() {
sat.printf("From Sat : Nominal Operation\r\n");
@@ -41,9 +22,10 @@
float batvol, temp; //voltage, temperature
int rcmd=0,cmdflag=0; //command variable
sattime.start();
- receive(rcmd,cmdflag); //interupting by ground station command
eps.turn_on_regulator();//turn on 3.3V conveter
for(int i = 0; i < 100; i++) {
+ com.xbee_receive(&rcmd,&cmdflag);//interupting by ground station command
+
//satellite condition led
condition = !condition;
@@ -107,7 +89,7 @@
//Please insert your answer
}
- initialize();
+ com.initialize();
}
}
sattime.stop();