Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pin = 13;
- unsigned long RPM;
- unsigned long duration;
- float W;
- void setup()
- {
- Serial.begin(9600);
- pinMode(pin, INPUT);
- }
- void loop()
- {
- duration = pulseIn(pin, HIGH);
- if(duration > 5000)
- {
- RPM = (1000000*60/duration);
- Serial.print(RPM);
- Serial.print(" RPM ");
- delay(10); // delay
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment