Skip to content

Instantly share code, notes, and snippets.

@sabas1080
Last active October 10, 2018 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sabas1080/e03dd2287873d80aa129d24ecee615be to your computer and use it in GitHub Desktop.
Save sabas1080/e03dd2287873d80aa129d24ecee615be to your computer and use it in GitHub Desktop.
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