I want to use info from a liquid flow meter (https://www.adafruit.com/product/833) in a circuitpython program I wrote. I've found a few examples of python code for RPI and Arduino code, but every one uses interrupts.
I know CP doesn't have interrupts, so I was wondering if I could still get useful information from the flow meter within CP's capability?
(useful meaning info that I could use to surmise flow rate, or total flow, etc.)
Code for Liquid Flow Meter W/O Interrupts
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- tannewt
- Posts: 3304
- Joined: Thu Oct 06, 2016 8:48 pm
Re: Code for Liquid Flow Meter W/O Interrupts
To measure the rate you can use a PulseIn to measure the period between pulses.
We did have the idea of adding a pulse counter but haven't added it yet: https://github.com/adafruit/circuitpython/pull/1423
We did have the idea of adding a pulse counter but haven't added it yet: https://github.com/adafruit/circuitpython/pull/1423
Please be positive and constructive with your questions and comments.