¿Ahhh entonces la idea es ir más rápido? Haberlo dicho antes...
#define analogPin1 A0
#define analogPin2 A1
bool hall1;
bool hall2;
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
ADCSRA &= ~7; // Acelerar el ADC
}
void loop() {
hall1 = analogRead(analogPin1) >= 880;
hall2 = (analogRead(analogPin2)+600) >= 860;
if (hall1 && !hall2)
{
PORTD = B00110000;
return;
}
if (!hall1 && hall2)
{
PORTD = B00001100;
return;
}
if (hall1 && hall2)
{
PORTD = B00011000;
return;
} else PORTD = B00100100;
}
Si esto aún no es suficiente, creo que ya sería hora de hacer unas reformas al hardware (no de Arduino, sino en la forma en que lees los sensores Hall)...