Skip to content

Instantly share code, notes, and snippets.

@MacoChave
Created August 18, 2021 05:42
Show Gist options
  • Save MacoChave/d3e80c32efa7cffce32a9692911761d1 to your computer and use it in GitHub Desktop.
Save MacoChave/d3e80c32efa7cffce32a9692911761d1 to your computer and use it in GitHub Desktop.
Arduino
//#define Hall_Sensor A0
#define Hall_Sensor_D 2
int Val2 = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(Hall_Sensor_D, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
//Val1 = analogRead(Hall_Sensor);
//Serial.print(Val1);
Val2 = digitalRead(Hall_Sensor_D);
if (Val2 == 1)
Serial.println("Flecha");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment