|
@@ -11,7 +11,7 @@
|
11
|
11
|
//
|
12
|
12
|
// This example code runs on an Intel Edison and uses mraa to acquire data
|
13
|
13
|
// from an ADIS16448. This data is then scaled and printed onto the terminal.
|
14
|
|
-//
|
|
14
|
+//
|
15
|
15
|
// This software has been tested to connect to an ADIS16448 through a level shifter
|
16
|
16
|
// such as the TI TXB0104. The SPI lines (DIN, DOUT, SCLK, /CS) are all wired through
|
17
|
17
|
// the level shifter and the ADIS16448 is also being powered by the Intel Edison.
|
|
@@ -45,21 +45,22 @@
|
45
|
45
|
int
|
46
|
46
|
main(int argc, char **argv)
|
47
|
47
|
{
|
48
|
|
- while(true)
|
49
|
|
- {
|
50
|
|
- upm::ADIS16448* imu = new upm::ADIS16448(0,3); //upm::ADIS16448(SPI,RST)
|
51
|
|
-
|
52
|
|
- //Read the specified register, scale it, and display it on the screen
|
53
|
|
- std::cout << "XGYRO_OUT:" << imu->gyroScale(imu->regRead(XGYRO_OUT)) << std::endl;
|
54
|
|
- std::cout << "YGYRO_OUT:" << imu->gyroScale(imu->regRead(YGYRO_OUT)) << std::endl;
|
55
|
|
- std::cout << "ZGYRO_OUT:" << imu->gyroScale(imu->regRead(ZGYRO_OUT)) << std::endl;
|
56
|
|
- std::cout << " " << std::endl;
|
57
|
|
- std::cout << "XACCL_OUT:" << imu->accelScale(imu->regRead(XACCL_OUT)) << std::endl;
|
58
|
|
- std::cout << "YACCL_OUT:" << imu->accelScale(imu->regRead(YACCL_OUT)) << std::endl;
|
59
|
|
- std::cout << "ZACCL_OUT:" << imu->accelScale(imu->regRead(ZACCL_OUT)) << std::endl;
|
60
|
|
- std::cout << " " << std::endl;
|
|
48
|
+ while(true)
|
|
49
|
+ {
|
|
50
|
+ //! [Interesting]
|
|
51
|
+ upm::ADIS16448* imu = new upm::ADIS16448(0,3); //upm::ADIS16448(SPI,RST)
|
61
|
52
|
|
62
|
|
- sleep(1);
|
63
|
|
- }
|
64
|
|
- return (0);
|
|
53
|
+ //Read the specified register, scale it, and display it on the screen
|
|
54
|
+ std::cout << "XGYRO_OUT:" << imu->gyroScale(imu->regRead(XGYRO_OUT)) << std::endl;
|
|
55
|
+ std::cout << "YGYRO_OUT:" << imu->gyroScale(imu->regRead(YGYRO_OUT)) << std::endl;
|
|
56
|
+ std::cout << "ZGYRO_OUT:" << imu->gyroScale(imu->regRead(ZGYRO_OUT)) << std::endl;
|
|
57
|
+ std::cout << " " << std::endl;
|
|
58
|
+ std::cout << "XACCL_OUT:" << imu->accelScale(imu->regRead(XACCL_OUT)) << std::endl;
|
|
59
|
+ std::cout << "YACCL_OUT:" << imu->accelScale(imu->regRead(YACCL_OUT)) << std::endl;
|
|
60
|
+ std::cout << "ZACCL_OUT:" << imu->accelScale(imu->regRead(ZACCL_OUT)) << std::endl;
|
|
61
|
+ std::cout << " " << std::endl;
|
|
62
|
+ //! [Interesting]
|
|
63
|
+ sleep(1);
|
|
64
|
+ }
|
|
65
|
+ return (0);
|
65
|
66
|
}
|