Code for Liquid Flow Meter W/O Interrupts

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
dsblock19
 
Posts: 18
Joined: Tue Mar 19, 2019 5:57 pm

Code for Liquid Flow Meter W/O Interrupts

Post by dsblock19 »

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.)

User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: Code for Liquid Flow Meter W/O Interrupts

Post by tannewt »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”