ElectronicCats / CayenneLPP

Library for Arduino compatible with Cayenne Low Power Payload
http://electroniccats.com/
MIT License
106 stars 48 forks source link

New Type RGB and PPM #12

Closed Dardrai closed 4 years ago

Dardrai commented 4 years ago

Hi ElectronicCats Team

Thank you for your awesome CayenneLPP library. For a project we needed some additional value Types, and maybe you'll be interested in this changes. New Values Type that we added:

uint8_t CayenneLPP::addPPM(uint8_t channel, uint32_t value); // 1 PPM unsigned - PPM means Parts per million 1PPM = 1 * 10 ^-6 = 0.000 001 uint8_t CayenneLPP::addRGB(uint8_t channel, uint8_t r, uint8_t g, uint8_t b); // R: 255 G: 255 B: 255

addPPM(0, 401); = 00 8F 01 91 { "ppm_0": 401 } and addRGB(0, 1, 145, 255); = 00 90 01 91 FF { "rgb_0": { "b": 255, "g": 145, "r": 1 } }

Dardrai commented 4 years ago

eh yes the build check fails but it shouldn't come from my changes, because I didn't change anything in the Basic_library_TTN/Basic_library_TTN.ino Example - the errors on this are mostly because of this definition, placeholders etc:

define loraSerial Serial1 -- some Boards don't know this Serial1 port and should be "defined"

define freqPlan REPLACE_ME // 'REPLACE_ME' was not declared in this scope

TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan); //in expansion of macro 'freqPlan' - because of the error above

Dardrai commented 4 years ago

Ppm is urn:oma:lwm2m:ext:3325 3325 3325 Concentration or urn:oma:lwm2m:x:10314 10314 10314 Particulates

We use the ppm atm for co2 and tvoc with a sensor like this: Adafruit SGP30 Air Quality Sensor Breakout - VOC and eCO2

And rgb is urn:oma:lwm2m:ext:3335 3335 3335 Colour should i rename it to addColour and addConcentration?

sabas1080 commented 4 years ago

Is ok for me, only 3325 change please name to "addConcentration"

3335 change please name to "addColour"

Dardrai commented 4 years ago

Perfect I'll do that tomorrow

@sabas1080 just to be shure PPM 3343 (ipso) 143 (dec) 8F (hex) Should also be changed to: Conentration 3325 125 7D And rgb to Colour 3335 135 87

To mach the numbers in http://openmobilealliance.org/wp/OMNA/LwM2M/LwM2MRegistry.html#extlabel ?

Dardrai commented 4 years ago

Commits:

sabas1080 commented 4 years ago

Thanks!