int hallsensorpin = D2;
int positiveled = D6;
int negativeled = D0;
void setup() {
// put your setup code here, to run once:
pinMode(positiveled, OUTPUT);
pinMode(negativeled,OUTPUT);
pinMode(hallsensorpin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (hallsensorpin == LOW){
digitalWrite(positiveled, HIGH);
}
else {
digitalWrite(negativeled, HIGH);
}
}