get humidity data and send to LoRa gateway
Dependencies: mbed X_NUCLEO_IKS01A2
Diff: main.cpp
- Revision:
- 3:24204ec0bc36
- Parent:
- 2:0b1cbb0060bc
- Child:
- 4:4a012fc4ecc4
diff -r 0b1cbb0060bc -r 24204ec0bc36 main.cpp --- a/main.cpp Wed Apr 22 14:52:38 2020 +0000 +++ b/main.cpp Wed Apr 22 14:59:39 2020 +0000 @@ -99,7 +99,15 @@ std::ostringstream ss; ss << humidity; - at_send("1515", string_to_hex(ss.str())); + + string val = ss.str(); + for(int i=0; i < val.length(); i++) + { + sprintf(val[2*i],"%X",*(val[i])); + } + + at_send("1515", val); + } wait(5); }