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.
Dependents: 3daf572bcae1 Team Team01_HEPTA_Trainig
Fork of HeptaCamera_GPS by
Diff: HeptaSerial.cpp
- Revision:
- 7:a41100627f55
- Parent:
- 6:c11f48bbb567
--- a/HeptaSerial.cpp Sat Aug 05 13:36:04 2017 +0000
+++ b/HeptaSerial.cpp Sat Aug 05 14:20:51 2017 +0000
@@ -12,7 +12,7 @@
* @param rx A pin for receive.
* @param baud Baud rate. (Default is Baud14400.)
*/
-HeptaSerial::HeptaSerial(PinName tx, PinName rx) : serial(tx, rx)
+HeptaSerial::HeptaSerial(PinName tx, PinName rx, PinName CAM, PinName GPS) : serial(tx, rx), CAM_SW(CAM), GPS_SW(GPS)
{
//serial.baud(baud);
}
@@ -610,11 +610,17 @@
return true;
}
+void HeptaSerial::camera_setting(void)
+{
+ CAM_SW = 1;
+ GPS_SW = 0;
+ serial.setTimeout(1);
+}
+
void HeptaSerial::Sync(void)
{
- serial.setTimeout(1);
+ camera_setting();
HeptaSerial::ErrorNumber err = HeptaSerial::NoError;
-
err = sync();
int count=0;
while(err) {
@@ -696,6 +702,8 @@
//*********************serial*********************//
void HeptaSerial::gps_setting(void)
{
+ CAM_SW = 0;
+ GPS_SW = 1;
serial._baud(9600);
serial.setTimeout(9999);
}
