Created
January 4, 2017 01:55
-
-
Save 9silva7/d9cb9157e91293673832fb102a2c8c84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
const int hallPin = 13; // Número de pin usado por el sensor de efecto hall | |
int hallState = 0; // variable para leer el estado del sensor hall | |
int RPM = 0; // variable para guardar las revoluciones por minuto | |
void setup() { | |
pinMode(hallPin, INPUT); // Inicializar el pin del sensor como ENTRADA: | |
Serial.begin(9600); // Establecer el puerto serie en | |
} | |
void loop() | |
{ // Inicio del bucle sin fin (loop) | |
Serial.print("RPM= "); | |
Serial.println(RPM); | |
hallState = digitalRead(hallPin); // Leer el estado del sensor de efecto hall: | |
RPM=hallState; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment