Guest User

Untitled

a guest
Jul 27th, 2014
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. int pin = 13;
  2. unsigned long RPM;
  3. unsigned long duration;
  4.  
  5. float W;
  6. void setup()
  7. {
  8. Serial.begin(9600);
  9. pinMode(pin, INPUT);
  10. }
  11. void loop()
  12. {
  13. duration = pulseIn(pin, HIGH);
  14. if(duration > 5000)
  15. {
  16. RPM = (1000000*60/duration);
  17. Serial.print(RPM);
  18. Serial.print(" RPM ");
  19.  
  20.  
  21.  
  22.  
  23.  
  24. delay(10); // delay
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment