Hey, Im connecting Adafruit motor shields to USB Host shields. I have connectivity problems and I found the issue to be the Void Setup Code.
Each code works fine individually but I can not combine them. The host shield will not connect! Please help!!
Code For USB Host Shield
void setup() {
Serial.begin(115200);
if (Usb.Init() == -1) {
Serial.print(F("\r\nOSC did not start"));
while(1); //halt
}
Serial.print(F("\r\nPS3 Bluetooth Library Started"));
}
Code for Adafruit Motorshield
void setup() {
AFMS1.begin();
AFMS2.begin();
AFMS3.begin();
M11->run(RELEASE);
M12->run(RELEASE);
M13->run(RELEASE);
M14->run(RELEASE);
M21->run(RELEASE);
M22->run(RELEASE);
M23->run(RELEASE);
M24->run(RELEASE);
M31->run(RELEASE);
M32->run(RELEASE);
M33->run(RELEASE);
M34->run(RELEASE);
}
Combined Code
void setup() {
Serial.begin(115200);
if (Usb.Init() == -1) {
Serial.print(F("\r\nOSC did not start"));
while(1); //halt
}
Serial.print(F("\r\nPS3 Bluetooth Library Started"));
AFMS1.begin();
AFMS2.begin();
AFMS3.begin();
M11->run(RELEASE);
M12->run(RELEASE);
M13->run(RELEASE);
M14->run(RELEASE);
M21->run(RELEASE);
M22->run(RELEASE);
M23->run(RELEASE);
M24->run(RELEASE);
M31->run(RELEASE);
M32->run(RELEASE);
M33->run(RELEASE);
M34->run(RELEASE);
}
The Adafruit host shield had commands at Serial.begin(9600) if that makes a difference. Thank you so much!!