So. question about code and how best to tackle this

Using one of the premade libraries that particle has to offer (current monitor) if I wanted to simultaneously monitor/log 3 separate wires… would I be best to include 3 pins in my.ino file , and create a separate .cpp file to monitor each pin ? Or is it more efficient to code all 3 pins I require into the main part? I get that using individual .cpp files would help break up the code… I’m very new to code, and I’m doing the best I can to grasp the concept. Any help would be appreciated.

Thanks.

What current sensor are you using?
This library is intended for the ControlEverything devices which work via I2C.
This way you can communicate with multiple sensors via one pin (well two since I2C is a two wire interface).
You’d just instanciate one CurrentMonitor object per sensor and .initialze() each of them according to their set I2C sub-address (on-board jumpers).

See here
https://github.com/ControlEverythingCom/Current_Monitor#public-accessible-methods

1 Like