Need Help for Hour Meter,PPM and Counter display in LCD

Folks,

I need help for a project of displaying and transmitting the same data via wifi.

Arduino & Components available:

  • Arduino Uno
  • Wifi Module
  • LCD IIC Module
  • Inductive proximity Sensor

Functions I need are as below:

  • Display of number parts (counter) with the help of inductive sensor - Code is working
  • Diplay of Parts per minute by the help of inductive sensor and timing functions - Code Needed
  • Display of running time of machine with the help of inductive sensor and timing, you can call it an hour meter. basically, it should stop counting time when a signal is not received and counting of time should resume when a signal is received again
  • Reset button to reset all above parameters and same should be shown in LCD
  • It will be best if we can show all the data from multiple machines to a single display via wifi

Below is code which works fine with inductive sensor and LCD for counting parts but I need code for rest of the functions.

#include <Wire.h>
#include <LiquidCrystal_PCF8574.h>

LiquidCrystal_PCF8574 lcd(0x27);  // set the LCD address to 0x27 for a 16 chars and 2 line display

  int show;
  int ledPin = 13; // pin for the LED
  int Sensor =7; // pin for a inductive sensor
  int val = 0; // variable for reading the pin status
  int counter = 0;
  int currentState = 0;
  int previousState = 0;

void setup()
{
  pinMode(ledPin, OUTPUT); // LED as output
  pinMode(Sensor, INPUT); // Inductive sensor as input
  Serial.begin(9600);
  lcd.begin(16, 2); // initialize the lcd
  show = 0;
}

void loop()
{
val = digitalRead(Sensor); // read input value
if (val == HIGH) { // check if the input is HIGH
digitalWrite(ledPin, HIGH); // turn LED on
currentState = 1;
}
else {
digitalWrite(ledPin, LOW); // turn LED off
currentState = 0;
}
if(currentState != previousState){
if(currentState == 1){
counter = counter + 1;

}
previousState = currentState;
}
    lcd.setBacklight(255);
    lcd.setCursor(0,0);
    lcd.print("COUNTER METER");
    lcd.setCursor(0,1);
    lcd.print("COUNTER=");
    lcd.setCursor(8,1);
    lcd.print(counter);
}

Thank You in Advance.

Did you write that code?
What have you tried for the rest?

Code for counter is working fine but for Parts per minute and hour meter it is not working.