123
Dependencies: mbed XBeeLib_Fixed
Revision 11:5b192dd2d8a6, committed 2022-03-23
- Comitter:
- hexogen85
- Date:
- Wed Mar 23 13:11:58 2022 +0000
- Parent:
- 10:3ff019e17aec
- Commit message:
- 123
Changed in this revision
diff -r 3ff019e17aec -r 5b192dd2d8a6 XBeeLib.lib --- a/XBeeLib.lib Fri Jul 29 12:13:01 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://developer.mbed.org/teams/Digi-International-Inc/code/XBeeLib/#b5f4a0e92249
diff -r 3ff019e17aec -r 5b192dd2d8a6 XBeeLib_Fixed.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/XBeeLib_Fixed.lib Wed Mar 23 13:11:58 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/maiorfi/code/XBeeLib_Fixed/#09e0b4f5a9e1
diff -r 3ff019e17aec -r 5b192dd2d8a6 config.h --- a/config.h Fri Jul 29 12:13:01 2016 +0200 +++ b/config.h Wed Mar 23 13:11:58 2022 +0000 @@ -21,15 +21,15 @@ #define SYNC_OPS_TIMEOUT_MS 2000 -//#define RADIO_TX NC /* TODO: specify your setup's Serial TX pin connected to the XBee module DIN pin */ -//#define RADIO_RX NC /* TODO: specify your setup's Serial RX pin connected to the XBee module DOUT pin */ +#define RADIO_TX PA_9 /* TODO: specify your setup's Serial TX pin connected to the XBee module DIN pin */ +#define RADIO_RX PA_10 /* TODO: specify your setup's Serial RX pin connected to the XBee module DOUT pin */ //#define RADIO_RTS NC /* TODO: specify your setup's Serial RTS# pin connected to the XBee module RTS# pin */ //#define RADIO_CTS NC /* TODO: specify your setup's Serial CTS# pin connected to the XBee module CTS# pin */ //#define RADIO_RESET NC /* TODO: specify your setup's GPIO (output) connected to the XBee module's reset pin */ //#define RADIO_SLEEP_REQ NC /* TODO: specify your setup's GPIO (output) connected to the XBee module's SLEEP_RQ pin */ //#define RADIO_ON_SLEEP NC /* TODO: specify your setup's GPIO (input) connected to the XBee module's ON_SLEEP pin */ -//#define DEBUG_TX NC /* TODO: specify your setup's Serial TX for debugging */ -//#define DEBUG_RX NC /* TODO: specify your setup's Serial RX for debugging (optional) */ +#define DEBUG_TX USBTX /* TODO: specify your setup's Serial TX for debugging */ +#define DEBUG_RX USBRX /* TODO: specify your setup's Serial RX for debugging (optional) */ #if !defined(RADIO_TX) #error "Please define RADIO_TX pin"
diff -r 3ff019e17aec -r 5b192dd2d8a6 main.cpp --- a/main.cpp Fri Jul 29 12:13:01 2016 +0200 +++ b/main.cpp Wed Mar 23 13:11:58 2022 +0000 @@ -27,9 +27,20 @@ const uint64_t remote_addr64 = remote.get_addr64(); log_serial->printf("\r\nGot a %s RX packet [%08x:%08x|%04x], len %d\r\nData: ", broadcast ? "BROADCAST" : "UNICAST", UINT64_HI32(remote_addr64), UINT64_LO32(remote_addr64), remote.get_addr16(), len); - + char str[10]; + int data1 = 0; + for (int i = 0; i < len; i++) - log_serial->printf("%02x ", data[i]); + { + str[i]=data[i]; + + ///data1=data1|(data2 << (8*(len-i-1))); + + } + + + std::sscanf(str, "d", &data1); + log_serial->printf("%d ", data1); log_serial->printf("\r\n"); }