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.
Dependencies: mbed
Fork of BLE_UARTConsole by
main.cpp
- Committer:
- smigielski
- Date:
- 2015-01-29
- Revision:
- 9:17b6ab281627
- Parent:
- 8:8db3894cf5e6
- Child:
- 10:4e3a56a61c3b
File content as of revision 9:17b6ab281627:
#include "mbed.h"
SPI spi(P0_28, p0_24, P0_29); // mosi, miso, sclk
DigitalOut cs(P0_23);
#define ADXL362_DEVID_AD 0x00
#define ADXL362_READ_REGISTER 0x0b
//Test that spi is working with adxl362
int main() {
cs=1;
while(1) {
cs = 0;
spi.write(ADXL362_READ_REGISTER);
spi.write(ADXL362_DEVID_AD);
//Device id is 0xAD
uint8_t val = spi.write(0x00);
cs = 1;
wait(1.0);
}
}
