| Electronic Components Datasheet Search |
|
DEV-13033 Datasheet(PDF) 5 Page - SparkFun Electronics |
|
|
|||||||||||||||||||||||||||||
DEV-13033 Datasheet(HTML) 5 Page - SparkFun Electronics |
|
5 / 8 page ![]() #include "mraa.hpp" #include <iostream> #include <unistd.h> #include "SFE_LSM9DS0.h" using namespace std; int main() { LSM9DS0 *imu; imu = new LSM9DS0(0x6B, 0x1D); // The begin() function sets up some basic parameters and tu rns the device // on; you may not need to do more than call it. It also re turns the "whoami" // registers from the chip. If all is good, the return valu e here should be // 0x49d4. Here are the initial settings from this functio n: // Gyro scale: 245 deg/sec max // Xl scale: 4g max // Mag scale: 2 Gauss max // Gyro sample rate: 95Hz // Xl sample rate: 100Hz // Mag sample rate: 100Hz // These can be changed either by calling appropriate functi ons or by // pasing parameters to the begin() function. There are nam ed constants in // the .h file for all scales and data rates; I won't repro duce them here. // Here's the list of fuctions to set the rates/scale: // setMagScale(mag_scale mScl) setMagODR(mag_odr mRat e) // setGyroScale(gyro_scale gScl) setGyroODR(gyro_odr gRa te) // setAccelScale(accel_scale aScl) setGyroODR(accel_odr aR ate) // If you want to make these changes at the point of callin g begin, here's // the prototype for that function showing the order to pas s things: // begin(gyro_scale gScl, accel_scale aScl, mag_scale mSc l, // gyro_odr gODR, accel_odr aODR, mag_odr mOD R) uint16_t imuResult = imu>begin(); cout<<hex<<"Chip ID: 0x"<<imuResult<<dec<<" (should be 0x49d 4)"<<endl; bool newAccelData = false; bool newMagData = false; bool newGyroData = false; bool overflow = false; // Loop and report data while (1) { // First, let's make sure we're collecting uptodate info rmation. The // sensors are sampling at 100Hz (for the accelerometer, magnetometer, and // temp) and 95Hz (for the gyro), and we could easily do a bunch of // crap within that ~10ms sampling period. Page 5 of 8 |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |