Combing code for hall effect RPM and Nextion tacho

How did it not work? This is necessary info.

I am thinking that maybe
Code: [Select]

sensorValue = analogRead(sensorPin);

shouldnt be commented out

The halltach code already has that line here:int sig=analogRead(A0);//read raw value of hall sensor

You said you tested the nextion code but you never responded on whether you tested halltach code. Do you know that it works? Most code I've seen that that tests for the length of time between pulses (as this one does) use the pulsein() function but without testing I cannot tell if it works, but I have doubts.

Actually the nextion code as you posted it cannot possibly work either. but since you said that it did I'm assuming you posted a snippet and actually do have a tested working version??

In the nextion code the simulated RPM is aquired in these 2 lines.

  sensorValue = analogRead(sensorPin);  // Read analog pin where the potentiometer is connected
  RealRPM = map (sensorValue, 0, 1023, 0, 8000); //  Remap pot to simulate an RPM value

It reads the potentiometer and maps it to a raw(not yet smoothed) RPM reading that is saved to the variable RealRPM.

If the halltach code is working correctly then it also generates a raw RPM reading that just needs to be saved in RealRPM.