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.
Fork of ESDC2014 by
Diff: communication.cpp
- Revision:
- 1:cbec1283a16a
- Parent:
- 0:3417ca0a36c0
- Child:
- 2:442902ec3aa1
diff -r 3417ca0a36c0 -r cbec1283a16a communication.cpp --- a/communication.cpp Tue Jul 01 10:59:33 2014 +0000 +++ b/communication.cpp Thu Jul 03 03:56:29 2014 +0000 @@ -28,12 +28,11 @@ #include <communication.h> Communication::Communication(MySerial* _DEBUG, MySerial *_IntelToMbed, MySerial *_MbedToArduino) -:compass(SDA, SCL) { this->_DEBUG = _DEBUG; this->_IntelToMbed = _IntelToMbed; this->_MbedToArduino = _MbedToArduino; - + this->compass=new COMPASS(COMPASS_TX,COMPASS_RX); init(); } @@ -439,13 +438,8 @@ } else if(action_type == 3) { - HMC5883L compasss(SDA, SCL); - campass_degree = 0; - unsigned short data1 = compasss.get_degree(); - wait(0.5); - unsigned short data2 = compasss.get_degree(); - - campass_degree = (data1 + data2) / 2; + + campass_degree = compass->Read(); uint8_t temp1,temp2; temp1 = campass_degree;