First fork the GitHub - myDevicesIoT/Cayenne-MQTT-Arduino: Cayenne MQTT Arduino Library repository. Then create the code for your particular sensor under the examples/CommunitySubmitted folder and test it out thoroughly. You can also submit your code to the community for further feedback and improvements. Then submit a pull request with your example code to the Cayenne-MQTT-Arduino repository.
Points to keep me mind while sending a pull request.
- All example sketch code must be created in examples/ CommunitySubmitted folder. Cayenne-MQTT-Arduino/examples/CommunitySubmitted at master · myDevicesIoT/Cayenne-MQTT-Arduino · GitHub
- The .ino file should be inside a new folder with the same name as the file. Eg Cayenne-MQTT-Arduino/examples/CommunitySubmitted/NewExample/NewExample.ino.
- The following info needs to be in a comment at the top of the example sketch. See other example sketches for how this is currently done.
- Any additional libraries needed.
- How to connect the sensor with the Arduino.
- How to assign the virtual pin.
-
Use the #define CAYENNE_PRINT Serial define at the top of the sketch before any includes unless it needs to be disabled because it conflicts with the example sketch.
-
Use the default #include <CayenneMQTTEthernet.h> header unless the example must use a specific board.
-
Use CAYENNE_OUT and CAYENNE_IN for sending/receiving data, if at all possible.
-
Use all caps #defines for constants like channel numbers.
-
Keep indentation consistent for readability.
-
Use the correct Cayenne data types and units for your data.
-
Comment any additional info about the code if needed.
Once a pull request is sent, we will examine the code and add comments if any changes are needed. When the code looks good we will merge in the pull request.