Last active
October 10, 2018 01:12
-
-
Save sabas1080/e03dd2287873d80aa129d24ecee615be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let comando = 0 | |
let stringSend = "" | |
pins.A6.digitalWrite(false) | |
airQuality.appStart() | |
bme280.Address(BME280_I2C_ADDRESS.ADDR_0x76) | |
bme280.PowerOn() | |
forever(function () { | |
comando = lora.beginPacket() | |
stringSend = "" + stringSend + bme280.temperature().toString() | |
stringSend = "" + stringSend + "," | |
stringSend = "" + stringSend + bme280.hunidity().toString() | |
stringSend = "" + stringSend + "," | |
stringSend = "" + stringSend + bme280.pressure().toString() | |
stringSend = "" + stringSend + "," | |
stringSend = "" + stringSend + airQuality.readCo2().toString() | |
for (let i = 0; i <= stringSend.length - 1; i++) { | |
lora.write(stringSend[i].charCodeAt(0)) | |
} | |
comando = lora.endPacket() | |
stringSend = "" | |
console.logValue("x", bme280.temperature()) | |
console.logValue("t", bme280.hunidity()) | |
console.logValue("y", bme280.pressure()) | |
console.logValue("z", airQuality.readCo2()) | |
pause(1000) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment