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: Hepta9axis HeptaBattery HeptaCamera_GPS HeptaTemp HeptaXbee SDFileSystem mbed
Fork of Team by
Revision 0:ea40bd156a1a, committed 2017-10-26
- Comitter:
- tuba
- Date:
- Thu Oct 26 11:35:16 2017 +0000
- Child:
- 1:20db10adb732
- Commit message:
- Second
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3daf572bcae1/.hg_archival.txt Thu Oct 26 11:35:16 2017 +0000 @@ -0,0 +1,5 @@ +repo: bdbd3d6fc5d5308c028049cfbd29473ed0fe6006 +node: 3daf572bcae1d1ecc05796fdba302f37ad4f651b +branch: default +latesttag: null +latesttagdistance: 16
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3daf572bcae1/Hepta9axis.lib Thu Oct 26 11:35:16 2017 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/HEPTA/code/Hepta9axis/#098423fb0371
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3daf572bcae1/HeptaBattery.lib Thu Oct 26 11:35:16 2017 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/HEPTA/code/HeptaBattery/#15a6a4425889
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3daf572bcae1/HeptaCamera_GPS.lib Thu Oct 26 11:35:16 2017 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/tuba/code/HeptaCamera_GPS/#a30fa71eddb7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3daf572bcae1/HeptaTemp.lib Thu Oct 26 11:35:16 2017 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/HEPTA/code/HeptaTemp/#96c3dd85be15
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3daf572bcae1/HeptaXbee.lib Thu Oct 26 11:35:16 2017 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/HEPTA/code/HeptaXbee/#8e925f198e21
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3daf572bcae1/SDFileSystem.lib Thu Oct 26 11:35:16 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/SDFileSystem/#8db0d3b02cec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/3daf572bcae1/main.cpp Thu Oct 26 11:35:16 2017 +0000
@@ -0,0 +1,107 @@
+#include "mbed.h"
+#include "SDFileSystem.h"
+#include "HeptaXbee.h"
+#include "HeptaCamera_GPS.h"
+#include "Hepta9axis.h"
+#include "HeptaTemp.h"
+#include "HeptaBattery.h"
+
+
+
+Serial pc(USBTX,USBRX, 9600);
+SDFileSystem sd(p5, p6, p7, p8, "sd");
+HeptaBattery bat(p16, p25);
+HeptaTemp temp(p17);
+Hepta9axis n_axis(p28, p27, 0xD0, 0x18);
+HeptaCamera_GPS cam_gps(p13, p14,p25, p24);
+HeptaXbee xbee(p9,p10);
+
+int main() {
+ xbee.baud(9600);
+ xbee.printf("Xbee comunication begin!\n\r");
+ char * dir_name = "/sd/Pictures";
+ mkdir(dir_name, 0777);
+
+ HeptaCamera_GPS::ErrorNumber err1 = HeptaCamera_GPS::NoError;
+ //
+ mkdir("/sd/Data", 0777);
+ pc.printf("Created!\n\r");
+ // while (true) {
+ // pc.putc(cam_gps.getc());
+ //}
+ while (true) {
+ pc.printf("Begin messurment\n\r");
+ float batLev;
+ float tempMes;
+
+ FILE *fp = fopen("/sd/Data/Data.txt", "w");
+ if(fp == NULL) {
+ error("Could not open file for write\n\r");
+ }
+
+ for (int i =0; i < 5; ++i)
+ {
+ char fname[64];
+ snprintf(fname, sizeof(fname), "%s/Picture%d.jpg", dir_name, i);
+ //snprintf(fname, sizeof(fname), "/sd/test.jpg");
+ FILE *fp_jpeg = fopen(fname, "w");
+ //cam_gps.set_image_file(fp_jpeg);
+ cam_gps.Sync();
+ cam_gps.initialize(HeptaCamera_GPS::Baud115200, HeptaCamera_GPS::JpegResolution320x240);
+
+ err1 = cam_gps.getJpegSnapshotPicture(fp_jpeg);
+ //cam_gps.test_jpeg_snapshot_picture(1);
+
+ if (HeptaCamera_GPS::NoError == err1) {
+ printf("[ OK ] : Picture taken\r\n");
+ } else {
+ printf("[FAIL] : Picture failed (Error=%02X)\r\n", (int)err1);
+ }
+ fclose(fp_jpeg);
+
+ fprintf(fp, "Picture data - Name [%s]\n\r--------------------------------\n\r", fname);
+ temp.temp_sense(&tempMes);
+ fprintf(fp, "Temperature [%f]\n\r", tempMes);
+ bat.vol(&batLev);
+ fprintf(fp, "Battery Level is [%f] Temperature [%f] ", batLev, tempMes);
+ float mx,my,mz;
+ n_axis.sen_mag(&mx,&my,&mz);
+ fprintf(fp, "Magnetometer[%f,%f,%f] ",mx,my,mz);
+ //pc.printf("Magnet %f,%f,%f\r\n",mx,my,mz);
+ float gx,gy,gz;
+ n_axis.sen_gyro(&gx,&gy,&gz);
+ fprintf(fp, "Gyroscope[%f,%f,%f] ",gx,gy,gz);
+ // pc.printf("Gyroscope %f,%f,%f\r\n",gx,gy,gz);
+ float ax,ay,az;
+ n_axis.sen_acc(&ax,&ay,&az);
+ fprintf(fp, "Acceletarion[%f,%f,%f]\r\n",ax,ay,az);
+ // pc.printf("Acceletarion %f,%f,%f\r\n",ax,ay,az);
+ int quality=0,stnum=0,gps_check=0;
+ char ns='A',ew='B',aunit='m';
+ float time=0.0,latitude=0.0,longitude=0.0,hacu=0.0,altitude=0.0;
+ cam_gps.gps_setting();
+ wait(1.0);
+ cam_gps.gga_sensing(&time, &latitude, &ns, &longitude, &ew, &quality, &stnum, &hacu, &altitude, &aunit, &gps_check);
+ if((gps_check==0)|(gps_check==1)) {
+ fprintf(fp, "GPGGA,%f,%f,%c,%f,%c,%d,%d,%f,%f,%c\r\n",time,latitude,ns,longitude,ew,quality,stnum,hacu,altitude,aunit);
+ }
+ fprintf(fp, "Picture data - End\n\r--------------------------------\n\r");
+ wait(1.0);
+ xbee.printf("num = %d\r\n",i);
+ }
+ fclose(fp);
+
+ FILE *fp1 = fopen("/sd/Data/Data.txt", "r");
+ char buf[100];
+ int nread = 0;
+ if (fp1) {
+ while ((nread = fread(buf, 1, sizeof buf, fp1)) > 0){
+ for (int i =0; i<nread; i++)
+ {
+ xbee.printf("%c", buf[i]);
+ }
+ }
+ } else error("Could not open file for write\n\r");
+ fclose(fp1);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3daf572bcae1/mbed.bld Thu Oct 26 11:35:16 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/e1686b8d5b90 \ No newline at end of file
