
FF1705 support added
Dependencies: libxDot-dev-mbed5-deprecated ISL29011
Fork of Dot-Examples by
Dot-Examples rev. 31:7ec180e84cb6 have been tested with xdot-library 3.0.0-19-gb6c0ba2 and mbed-os-5.6.2
Revision 30:2c57bd7c0324, committed 2017-10-13
- Comitter:
- gorazdko
- Date:
- Fri Oct 13 05:39:31 2017 +0000
- Parent:
- 29:8d1741a4b16b
- Child:
- 31:7ec180e84cb6
- Commit message:
- Peer to peer example tested on FF1705
Changed in this revision
--- a/examples/example_config.h Thu Oct 12 12:01:30 2017 +0000 +++ b/examples/example_config.h Fri Oct 13 05:39:31 2017 +0000 @@ -9,7 +9,7 @@ // the active example is the one that will be compiled #if !defined(ACTIVE_EXAMPLE) -#define ACTIVE_EXAMPLE MANUAL_EXAMPLE +#define ACTIVE_EXAMPLE PEER_TO_PEER_EXAMPLE #endif // the active channel plan is the one that will be compiled
--- a/examples/src/peer_to_peer_example.cpp Thu Oct 12 12:01:30 2017 +0000 +++ b/examples/src/peer_to_peer_example.cpp Fri Oct 13 05:39:31 2017 +0000 @@ -29,7 +29,7 @@ Serial pc(USBTX, USBRX); #ifdef TARGET_FF1705_L151CC -uint16_t lux[3]={1,2,3}; +AnalogIn lux(A0); #elif defined(TARGET_XDOT_L151CC) I2C i2c(I2C_SDA, I2C_SCL); ISL29011 lux(i2c); @@ -156,7 +156,7 @@ // display configuration display_config(); -#if defined(TARGET_XDOT_L151CC) +#if defined(TARGET_XDOT_L151CC) && !defined(TARGET_FF1705_L151CC) // configure the ISL29011 sensor on the xDot-DK for continuous ambient light sampling, 16 bit conversion, and maximum range lux.setMode(ISL29011::ALS_CONT); lux.setResolution(ISL29011::ADC_16BIT); @@ -172,25 +172,17 @@ join_network(); } -#ifdef TARGET_FF1705_L151CC - // get some dummy data and send it to the gateway - static int cnt = 0; - light = lux[cnt++]; - if (cnt >= sizeof(lux)) cnt=0; - - tx_data.push_back((light >> 8) & 0xFF); - tx_data.push_back(light & 0xFF); - logInfo("light: %lu [0x%04X]", light, light); - send_data(tx_data); + -#elif defined(TARGET_XDOT_L151CC) +#if defined(TARGET_XDOT_L151CC) && !defined(TARGET_FF1705_L151CC) // get the latest light sample and send it to the gateway light = lux.getData(); tx_data.push_back((light >> 8) & 0xFF); tx_data.push_back(light & 0xFF); logInfo("light: %lu [0x%04X]", light, light); send_data(tx_data); -#else + +#else // TARGET_FF1705_L151CC // get some dummy data and send it to the gateway light = lux.read_u16(); tx_data.push_back((light >> 8) & 0xFF);