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 HEPTA_CDH_lite HEPTA_COM_lite LPS25HB_I2C HEPTA_SENSOR_lite HEPTA_EPS_lite
Revision 2:30f72f09756e, committed 2021-08-17
- Comitter:
- heptasat2021
- Date:
- Tue Aug 17 11:01:44 2021 +0000
- Parent:
- 1:ddac5ec89167
- Child:
- 3:e5ae22e02335
- Commit message:
- For Hepta-Sat Lite
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HEPTA_COM_lite.lib Tue Aug 17 11:01:44 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/heptasat2021/code/HEPTA_COM_lite/#92f22b090477
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HEPTA_EPS_lite.lib Tue Aug 17 11:01:44 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/heptasat2021/code/HEPTA_EPS_lite/#d5bf433a0032
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HEPTA_SENSOR_lite.lib Tue Aug 17 11:01:44 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/heptasat2021/code/HEPTA_SENSOR_lite/#82c6d3329af2
--- a/main.cpp Wed Aug 11 03:50:32 2021 +0000
+++ b/main.cpp Tue Aug 17 11:01:44 2021 +0000
@@ -1,19 +1,33 @@
#include "mbed.h"
+#include "HEPTA_EPS.h"
#include "HEPTA_CDH.h"
+#include "HEPTA_SENSOR.h"
+#include "HEPTA_COM.h"
HEPTA_CDH cdh(PB_5, PB_4, PB_3, PA_8, "sd");
-Serial pc(USBTX,USBRX,9600);
+HEPTA_EPS eps(PA_0,PA_4);
+HEPTA_SENSOR sensor(PA_7,PB_7,PB_6,0xD0);
+HEPTA_COM com(PA_9,PA_10,9600);
+Serial sat(USBTX,USBRX,9600);
int main()
{
- pc.printf("Hello World!\n");
-
- mkdir("/sd/mydir", 0777);
-
- FILE *fp = fopen("/sd/mydir/sdtest.txt", "w");
- if(fp == NULL) {
- error("Could not open file for write\r\n");
+ sat.printf("Xbee Uplink Downlink Mode\r\n");
+ int rcmd=0,cmdflag=0;
+ float ax,ay,az;
+ for(int i=0;i<10;i++){
+ com.xbee_receive(&rcmd,&cmdflag);
+ com.printf("num=%d\r\n",i);
+ if(cmdflag==1){
+ if(rcmd=='a'){
+ sat.printf("rcmd=%c,cmdflag=%d\r\n",rcmd,cmdflag);
+ com.printf("Hepta-Sat Lite Uplink Ok\r\n");
+ for(int i=0;i<10;i++){
+ sensor.sen_acc(&ax,&ay,&az);
+ com.printf("%f,%f,%f\r\n",ax,ay,az);
+ wait_ms(1000);
+ }
+ }
+ com.initialize();
+ }
+ wait_ms(1000);
}
- fprintf(fp, "Hello my name is HEPTA\r\n");
- fclose(fp);
-
- pc.printf("Goodbye World!\r\n");
}
\ No newline at end of file