Sensor
Pulse counting (ULP co-processor).
The counter class below is verbatim from the device
firmware (firmware_core.py of Logger Pro v9).
- Analog measurement note:
There is no separate analog-sensor class in the firmware. Raw ADC conversions are done by
findylab.core.fw.adcMeasure()and the 4-20 mA scaling happens inline in the user-editablemeasure()hook inlast.py:ina1 = round(self.adcMeasure(b'') / 100, 2) # mA qty = (ina1 - sensor_min) * ((qty_max - qty_min) / (sensor_max - sensor_min))
with the calibration values read from parameters 553-556 (AIN1) or 578-581 (AIN2) - see System IDs.
- class findylab.sensor.counter[source]
ULP pulse counting on the two digital inputs (IO4/IO14).
Verbatim class from
firmware_core.py. The ESP32 ULP co-processor samples the inputs every few milliseconds and counts debounced edges - including during deep sleep. Never instantiated; the methods take noself:counter.getSamplings()
Note
Requires
ulp_main.binin the device filesystem - without itinitCounter()raisesOSError(ENOENT).- valFromMem()[source]
Reads one counter value from ULP memory.
Edge counters count both edges, so the raw value is halved.
- Parameters:
val (int) – ULP memory address.
- Returns:
Pulse count (raw edge count // 2).
- Return type:
int
- getSamplings()[source]
Collects the pulse deltas since the previous wakeup.
Verifies the ULP is alive (restarts it and clears the tracking parameters when frozen), reads both edge counters, computes the deltas with 15-bit overflow handling, accumulates them into parameters 437/439 and appends the deltas to ring-buffers 540/541.