Skip to content

Latest commit

 

History

History
103 lines (54 loc) · 7 KB

ADDING_SENSORS.md

File metadata and controls

103 lines (54 loc) · 7 KB

OpenLog Artemis : How To Add A New Sensor

These are abbreviated instructions on how to add a new sensor to the OLA firmware. It's more of an aide-memoire really... Sorry about that.

Caveat: this is currently how a new sensor is added, for version v1.n of the OLA firmware using v1.2.n of the Apollo3 boards (the OLA code is compiled using the SparkFun RedBoard Artemis ATP (All The Pins) board). This will change, dramatically, when we upgrade to v2 of Apollo3 and integrate BLE support.

Use The Release Candidate Branch

First up, please target any commits at the release_candidate branch, so they can be tested before being merged into the main branch.

OpenLog_Artemis.ino

Sensors.ino

gatherDeviceValues

printHelperText

autoDetect.ino

addDevice

  • This code is called to add the discovered device to the linked list of active devices. Add a case for the new sensor. The class name comes from the library. The config struct is defined in settings.h.

beginQwiicDevices

  • This is the code that is called to start (begin) the device. Add a case for the new sensor. Update qwiicPowerOnDelayMillis if this device needs extra time to get its act together on power-up.

configureDevice

getConfigFunctionPtr

swap

testDevice

  • This is the code used to detect the sensor. Add a case for the new sensor. Provide some indication of how robust the detection is. Confidence would be high if the .begin writes and reads unique data to/from the sensor. Confidence is low if .begin only uses the standard isConnected I2C address test.

getDeviceName

  • This is where the sensor name is defined as text. Add a case for the new sensor. Keep it brief and follow the same format as the other sensors: usually TYPE (PRESSURE, TEMPERATURE etc.) followed by the abbreviated manufacturer's part number

menuAttachedDevices.ino

menuAttachedDevices

menuConfigure_

nvm.ino

recordDeviceSettingsToFile

parseDeviceLine

settings.h

enum

settings struct

README.md

  • Add the new sensor to the list in README.md. Include a link to the product page
  • Update the OLA product page on Sparkle - add the new sensor to the list

CHANGELOG.md

  • Update CHANGELOG.md. Start a new version if you need to. Add the new sensor to the change notes

SENSOR_UNITS.md

  • Update SENSOR_UNITS.md. Add the new sensor to the appropriate section at the start of the document. Add a unit table for the sensor at the end of the document.