Example of using the HSCDTD008A Geomagnetic Sensor.
Revision 1:2d4aa9e794a5, committed 2021-06-20
- Comitter:
- hudakz
- Date:
- Sun Jun 20 14:20:26 2021 +0000
- Parent:
- 0:5090d2766d5e
- Commit message:
- Example of using the HSCDTD008A Geomagnetic Sensor.
Changed in this revision
| HSCDTD008A.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/HSCDTD008A.lib Sun Jun 20 13:56:50 2021 +0000 +++ b/HSCDTD008A.lib Sun Jun 20 14:20:26 2021 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/hudakz/code/HSCDTD008A/#ccf912737de7 +https://os.mbed.com/users/hudakz/code/HSCDTD008A/#b90695c17177
--- a/main.cpp Sun Jun 20 13:56:50 2021 +0000
+++ b/main.cpp Sun Jun 20 14:20:26 2021 +0000
@@ -3,7 +3,7 @@
#define M_PI 3.14159265358979323846
-HSCDTD008A compass(PB_7, PB_6, PA_8);
+HSCDTD008A compass(PB_7, PB_6);
Watchdog& watchdog = Watchdog::get_instance();
int main()
@@ -17,7 +17,7 @@
float bearing;
printf("Starting selftest.. ");
- if (compass.selftest() == OK) {
+ if (compass.selfTest() == OK) {
printf("passed\r\n");
}
else {
@@ -41,7 +41,7 @@
compass.enableFifo();
compass.normalMode(0b10);
- watchdog.start(3000); // clears WDTOF
+ watchdog.start(3000);
while (true) {
printf("-----------------\r\n");