Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Reply To: Adding a new modbus sensor using current ones as inspiration.

Home Forums Environmental Sensors Adding a new modbus sensor using current ones as inspiration. Reply To: Adding a new modbus sensor using current ones as inspiration.

#17054
neilh20
Participant

Hello Erik, sounds like you are on the path to learning Cpp.  One issue to keep in mind is that the code is what happens, the reality check, the documentation is for readability.  You may want to  list what gas sensor you are looking at for the max help.

So I don’t follow your question  – where do you get the code snippet from the first section  which says there are two power pins “nlAdapterPower” and nanolevelPower   which looks reasonable.

Then in the constructor KellerNanolevel.h they map to int8_t and int8_t – the name is only descriptive, it isn’t used for anything.

Part of new code is having a plan including figuring out what you need to learn. a) can you get enough technical detail for the plan to be likely to work – ie for your case the Modbus map of the gas sensor  b) The other part of coding is set up a target test bench. b1) The first part of a test bench is proving that the test bench is working, b2) typically by enabling debug and checking the message flow on a known working sensor and then b3) making modifications for your new target sensor.  Do you have ANY ModularSensors modbus sensors that you could start with?   Just a thought 🙂