Device to measure angle and get IMU measurements.
Dependencies: mbed commands BLE_API nRF51822
Diff: Storage.cpp
- Revision:
- 6:75263c93daf7
- Parent:
- 5:46947b447701
--- a/Storage.cpp Sun Jun 07 14:11:26 2015 +0000 +++ b/Storage.cpp Sun Jun 07 21:58:02 2015 +0000 @@ -1,20 +1,13 @@ #include "Storage.h" SPI spi(p20, p22, p25); // mosi, miso, sclk -DigitalOut cs(p14); - -Storage* Storage::instance = new Storage(); +DigitalOut cs(p14); //Chip select Storage::Storage() { cs = 1; spi.format(8,3); - spi.frequency(150000); -} - -Storage* Storage::getInstance() -{ - return instance; + spi.frequency(200000); } void Storage::setup() @@ -50,15 +43,6 @@ return status; } -int8_t Storage::getSR2() -{ - cs = 0; - spi.write(0x35); - int8_t status = spi.write(0x00); - cs = 1; - return status; -} - void Storage::clearSR(){ cs = 0; spi.write(0x30);