I've discovered some pretty interesting things on the connection of my Mega ADK to the Galaxy Nexus 4.0.4.
If I have a loop like this, it works just fine
void loop() {
if(acc.isConnected()){
Serial.println("Accessory Connected");
delay(1000);
}
else
Serial.println("Accessory Not Connected");
}
But if I make a small change to it like that, it doesn't connect to the phone.
void loop() {
if(acc.isConnected())
Serial.println("Accessory Connected");
else
Serial.println("Accessory Not Connected");
delay(1000);
}
My setup looks like this:
void setup() {
Serial.begin(115200);
pinMode(led, OUTPUT);
pinMode(HabilitaMotores, OUTPUT);
pinMode(Motor0FW, OUTPUT);
pinMode(Motor0RW, OUTPUT);
pinMode(Motor1FW, OUTPUT);
pinMode(Motor1RW, OUTPUT);
acc.powerOn();
}
Have you ever seen this before? Am I making a terrible mistake that I can't see?