char* MAX44009Message::getLoRaMessageString(){ loraMessage.clear(); char buffer[20]; sprintf(buffer,"%s:%.2f,",loraMessageId.at(0).c_str(),getLux()); loraMessage.append(buffer); return (char*) loraMessage.c_str(); }
void SNShield::getAll(){ float acc[3]; this->temp = getTemp(); this->lux = getLux(); readAccelData(acc); this->accx = acc[0]; this->accy = acc[1]; this->accz = acc[2]; }
int main() { int fd = wiringPiI2CSetup(MAX44009_ADDR) ; printf("Lux: %.3f \n", getLux(fd)); return 0 ; }