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: R1Arobo_Maika_B 2021Arobo_UMAPYOI 2021Arobo_YUMIPYOI
Serial6050.h@4:413d60ebdcf2, 2019-09-18 (annotated)
- Committer:
- Suzutomo
- Date:
- Wed Sep 18 07:52:24 2019 +0000
- Revision:
- 4:413d60ebdcf2
- Parent:
- 2:00a8daf9203b
add Device Reset
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yopcyuuu | 0:c3d09c97649b | 1 | #pragma once |
| yopcyuuu | 0:c3d09c97649b | 2 | #include "mbed.h" |
| yopcyuuu | 0:c3d09c97649b | 3 | |
| yopcyuuu | 0:c3d09c97649b | 4 | #define ERROR -10000 |
| yopcyuuu | 0:c3d09c97649b | 5 | |
| yopcyuuu | 0:c3d09c97649b | 6 | enum axis { |
| yopcyuuu | 0:c3d09c97649b | 7 | YAW, |
| yopcyuuu | 0:c3d09c97649b | 8 | PITCH, |
| yopcyuuu | 0:c3d09c97649b | 9 | ROLL |
| yopcyuuu | 0:c3d09c97649b | 10 | }; |
| yopcyuuu | 0:c3d09c97649b | 11 | |
| yopcyuuu | 0:c3d09c97649b | 12 | class Serial6050 |
| yopcyuuu | 0:c3d09c97649b | 13 | { |
| yopcyuuu | 0:c3d09c97649b | 14 | private: |
| yopcyuuu | 0:c3d09c97649b | 15 | RawSerial serial; |
| yopcyuuu | 0:c3d09c97649b | 16 | DigitalOut rst; |
| yopcyuuu | 0:c3d09c97649b | 17 | int resetValue; |
| yopcyuuu | 2:00a8daf9203b | 18 | int Bias; |
| yopcyuuu | 2:00a8daf9203b | 19 | void intReceive(); |
| Suzutomo | 4:413d60ebdcf2 | 20 | bool useResetPin; |
| yopcyuuu | 0:c3d09c97649b | 21 | public: |
| Suzutomo | 4:413d60ebdcf2 | 22 | Serial6050(PinName tx, PinName rx, PinName resetPin); |
| yopcyuuu | 0:c3d09c97649b | 23 | void init(); |
| yopcyuuu | 0:c3d09c97649b | 24 | void reset(); |
| yopcyuuu | 2:00a8daf9203b | 25 | volatile uint8_t data; |
| yopcyuuu | 2:00a8daf9203b | 26 | volatile int Deg; |
| yopcyuuu | 0:c3d09c97649b | 27 | float read(); |
| yopcyuuu | 0:c3d09c97649b | 28 | }; |