Created
August 7, 2018 20:42
-
-
Save bofh/e6ec117ec6f11f1bcf57e9fa257a2707 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/lib.rs b/src/lib.rs | |
index ecabc08..84e5233 100644 | |
--- a/src/lib.rs | |
+++ b/src/lib.rs | |
@@ -257,6 +257,13 @@ where | |
}) | |
} | |
+ /// Self test for gyroscope and accelerometer | |
+ pub fn self_test(&mut self) -> Result<(), E> { | |
+ self.write(Register::SMPLRT_DIV, 0x00)?; | |
+ | |
+ Ok(()) | |
+ } | |
+ | |
/// Applies a digital low pass filter to the accelerometer data | |
pub fn a_filter(&mut self, dlpf: Dlpf) -> Result<(), E> { | |
self.write(Register::ACCEL_CONFIG_2, dlpf as u8)?; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment