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:
- 1:97a3a91ce950
- Parent:
- 0:c3d09c97649b
- Child:
- 2:00a8daf9203b
--- a/Serial6050.cpp Thu Sep 20 01:13:45 2018 +0000
+++ b/Serial6050.cpp Wed Sep 26 00:55:39 2018 +0000
@@ -13,7 +13,7 @@
while(1) {
serial.putc(100);
if(serial.readable()) {
- if(serial.getc() == 0x80) break;
+ if(serial.getc()) break;
}
}
serial.attach(this, &Serial6050::intReceive, RawSerial::RxIrq);
@@ -23,13 +23,13 @@
void Serial6050::reset()
{
- resetValue = higher >> 7 + lower - 8192;
+ resetValue = lower - 127;
}
float Serial6050::read()
{
- int value = higher >> 7 + lower;
- return (value - 8192 - resetValue) / 10.0;
+ int value = lower;
+ return (value - 127 - resetValue) / 10.0;
}
\ No newline at end of file