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: ADXL362_v3 BLE_API mbed nRF51822
Fork of BLENano_SimpleTemplate_adxl362_170813 by
Revision 9:ca9a58478ddd, committed 2017-09-05
- Comitter:
- Jun_adi
- Date:
- Tue Sep 05 06:20:07 2017 +0000
- Parent:
- 8:18b02ffb6330
- Child:
- 10:c90237505549
- Commit message:
- Update ADXL362.h file for BLE nano
Changed in this revision
--- a/ADXL362.lib Sun Aug 13 05:30:51 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://developer.mbed.org/users/Jun_adi/code/ADXL362_v2/#3af69afe5457
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ADXL362_v3.lib Tue Sep 05 06:20:07 2017 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/Jun_adi/code/ADXL362_v3/#fe49d0e51baa
--- a/main.cpp Sun Aug 13 05:30:51 2017 +0000
+++ b/main.cpp Tue Sep 05 06:20:07 2017 +0000
@@ -120,22 +120,21 @@
//onTimeout
//======================================================================
-/*
+
void m_status_check_handle(void)
{
-
- uint8_t buf[2];
+ //uint8_t x,y,z;
+ uint8_t x[1];
+ x[0] = adxl362.scanx_u8();
+ //y=adxl362.scany_u8();
+ //z=adxl362.scanz_u8();
+ //printf("x = %x y = %x z = %x\r\n",x,y,z);
+ //wait_ms(10);
+
+ //Send out
+ ble.updateCharacteristicValue(rxCharacteristic.getValueAttribute().getHandle(), x, 1);
+}
- //Read Analog port
- float s = ANALOG;
- uint16_t value = s*1024;
- buf[0] = (value >> 8);
- buf[1] = value;
-
- //Send out
- ble.updateCharacteristicValue(rxCharacteristic.getValueAttribute().getHandle(), buf, 2);
-}
-*/
//======================================================================
//convert reverse UUID
@@ -158,13 +157,12 @@
adxl362.reset();
wait_ms(600); // we need to wait at least 500ms after ADXL362 reset
adxl362.set_mode(ADXL362::MEASUREMENT);
-
-
+
uint8_t base_uuid_rev[16];
//Timer Setting [us]
Ticker ticker;
- //ticker.attach_us(m_status_check_handle, TICKER_TIME);
+ ticker.attach_us(m_status_check_handle, TICKER_TIME);
//BLE init
ble.init();
@@ -205,17 +203,6 @@
//------------------------------------------------------------
while(1)
{
- //uint8_t x,y,z;
- uint8_t x[1];
- x[0] = adxl362.scanx_u8();
- //y=adxl362.scany_u8();
- //z=adxl362.scanz_u8();
- //printf("x = %x y = %x z = %x\r\n",x,y,z);
- //wait_ms(10);
-
- //Send out
- ble.updateCharacteristicValue(rxCharacteristic.getValueAttribute().getHandle(), x, 1);
-
ble.waitForEvent();
}
}
\ No newline at end of file
