A multifunctional and modular Firmware for Multitech's mDot based on ARM mBed provides a widerange of functionality for several Sensors such as MAX44009, BME280, MPU9250, SI1143 and uBlox. It allows you to quickly build a Sensornode that measures specific data with its sensors and sends it via LoRaWAN.
Dependencies: mDot_LoRa_Sensornode_Flowmeter_impl mbed-rtos mbed
MAX44009Message.cpp
00001 /* 00002 * MAX44009Message.cpp 00003 * 00004 * Created on: Jun 1, 2016 00005 * Author: Adrian 00006 */ 00007 00008 #include "MAX44009Message.h " 00009 #include "main.h" 00010 00011 MAX44009Message::MAX44009Message() { 00012 this->loraMessageId.push_back(MAX44009_MESSAGE_ID); 00013 } 00014 00015 MAX44009Message::~MAX44009Message() { 00016 // TODO Auto-generated destructor stub 00017 } 00018 00019 void MAX44009Message::setLux(float lux){ 00020 this->lux = lux; 00021 00022 } 00023 00024 float MAX44009Message::getLux(){ 00025 return lux; 00026 } 00027 00028 char* MAX44009Message::getLoRaMessageString(){ 00029 loraMessage.clear(); 00030 char buffer[20]; 00031 sprintf(buffer,"%s:%.2f,",loraMessageId.at(0).c_str(),getLux()); 00032 loraMessage.append(buffer); 00033 return (char*) loraMessage.c_str(); 00034 } 00035
Generated on Tue Jul 12 2022 21:35:26 by 1.7.2