SEN0217

6
7 GNU Lesser General Public License.
8 See <http://www.gnu.org/licenses/> for details.
9 All above must be included in any redistribution
10 ****************************************************/
11
12 /***********Notice and Trouble shooting***************
13 1.Connection and Diagram can be found here http://www.dfrobot.com/wiki/i
ndex.php?title=Water_Flow_Sensor_-_1/2%E2%80%B3_SKU:_SEN0217#Sample_Code
14 2.This code is tested on Arduino Uno.
15 ****************************************************/
16 volatile double waterFlow;
17 void setup() {
18 Serial.begin(9600); //baudrate
19 waterFlow = 0;
20 attachInterrupt(0, pulse, RISING); //DIGITAL Pin 2: Interrupt 0
21 }
22 void loop() {
23 Serial.print("waterFlow:");
24 Serial.print(waterFlow);
25 Serial.println(" L");
26 delay(500);
27 }
28
29 void pulse() //measure the quantity of square wave
30 {
31 waterFlow += 1.0 / 450.0;
32 }
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.
Powered By DFRobot © 2008-2017

SEN0217

Mfr. #:
Manufacturer:
DFRobot
Description:
Multiple Function Sensor Development Tools Gravity Water Flow Sensor (1/2in)
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet