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
Diff: Serial6050.cpp
- Revision:
- 4:413d60ebdcf2
- Parent:
- 3:601cfc41e50a
--- a/Serial6050.cpp Wed Apr 17 07:57:05 2019 +0000
+++ b/Serial6050.cpp Wed Sep 18 07:52:24 2019 +0000
@@ -3,13 +3,17 @@
Serial6050::Serial6050(PinName tx, PinName rx, PinName resetPin)
: serial(tx, rx, 38400), rst(resetPin), Deg(0), Bias(0)
{
+ if (resetPin == NC) useResetPin = false;
+ else useResetPin = true;
}
void Serial6050::init()
{
- rst = 1;
- wait(0.5);
- rst = 0;
+ if (useResetPin) {
+ rst = 1;
+ wait(0.1);
+ rst = 0;
+ }
while(1) {
serial.putc(100);
if(serial.readable()) {
@@ -17,7 +21,7 @@
}
}
serial.attach(this, &Serial6050::intReceive, RawSerial::RxIrq);
- wait(0.1);
+ wait(1);
reset();
}