const int sensorPin = 2; volatile long pulseCount = 0; float flowRate = 0.0; unsigned int flowMilliLitres = 0; unsigned long totalMilliLitres = 0; unsigned long oldTime = 0; void pulseCounter() pulseCount++; void setup() Serial.begin(9600); pinMode(sensorPin, INPUT_PULLUP); // Interrupt 0 is tied to digital pin 2 attachInterrupt(digitalPinToInterrupt(sensorPin), pulseCounter, FALLING); void loop() if((millis() - oldTime) > 1000) Total: "); Serial.print(totalMilliLitres); Serial.println(" mL"); pulseCount = 0; attachInterrupt(digitalPinToInterrupt(sensorPin), pulseCounter, FALLING); Use code with caution. Troubleshooting Simulation Errors

An exclusive library typically consists of two main file types that must be added to the Proteus root folder:

Yfs201 - Proteus Library Exclusive ((link))

const int sensorPin = 2; volatile long pulseCount = 0; float flowRate = 0.0; unsigned int flowMilliLitres = 0; unsigned long totalMilliLitres = 0; unsigned long oldTime = 0; void pulseCounter() pulseCount++; void setup() Serial.begin(9600); pinMode(sensorPin, INPUT_PULLUP); // Interrupt 0 is tied to digital pin 2 attachInterrupt(digitalPinToInterrupt(sensorPin), pulseCounter, FALLING); void loop() if((millis() - oldTime) > 1000) Total: "); Serial.print(totalMilliLitres); Serial.println(" mL"); pulseCount = 0; attachInterrupt(digitalPinToInterrupt(sensorPin), pulseCounter, FALLING); Use code with caution. Troubleshooting Simulation Errors

An exclusive library typically consists of two main file types that must be added to the Proteus root folder: yfs201 proteus library exclusive

  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod