An I2C Scanner, to test that your I2C can be detected. Works with the NRF51 Development Kit.
Dependencies: mbed-src-nrf51822
Diff: main.cpp
- Revision:
- 1:117c1bb3ce43
- Parent:
- 0:839b7264c387
diff -r 839b7264c387 -r 117c1bb3ce43 main.cpp --- a/main.cpp Thu Jun 09 11:06:51 2016 +0000 +++ b/main.cpp Thu Jun 30 07:43:22 2016 +0000 @@ -4,7 +4,7 @@ #define SCL 7 #define SDA 30 -TwoWire Wire = TwoWire(NRF_TWI0); +TwoWire Wire = TwoWire(NRF_TWI1); int main(void) { @@ -23,7 +23,7 @@ if (error == 0) { - printf("I2C device found at address 0x%X %d \n\r", address, error); //Returns 7-bit address + printf("I2C device found at address %d 0x%X %d \n\r",address, address, error); //Returns 7-bit address nDevices++; } }