I can’t seem to get serial communication working on the Qik 2s9v1 motor controller. After trying the demo code provided by Pololu, I stepped back and created a simple sketch that implemented the steps in the Qik 2s9v1 Troubleshooting chapter using just the SoftwareSerial library. I’m driving the Qik from a Pololu AStar32U4 MIni. The connections from the MIni to the Qik are as follows
Mini Qik
GND GND
5V VCC
D3 RX
D2 TX
The 38400 baud jumper is on place on the Qik (i.e., the two outer pins)
Per the troubleshooting guide
- I have a green flashing heartbeat
- When I transmit 0xBF I get a red light on the Qik
- When I then transmit 0x82 the red light goes off.
HOWEVER, I don’t seem to get a byte in response to sending 0x82. The code (below) hangs looping on the “available()” call, never printing out the response or the “DONE” string
Do you have any suggestions what I might try next? I’ll just mention that this is the second Qik that I’ve tried (and had the same problem), so I’m leaning towards some issue with how I’m using the library rather than any hardware problem.
Thanks for any help,
Brian
==============================================================
#include <SoftwareSerial.h>
#define rxPin 2
#define txPin 3
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
void setup(){
Serial.begin(9600);
mySerial.begin(38400);
delay(5000);
Serial.println("STARTING");
mySerial.write(0xBF);
delay(3000);
mySerial.listen();
mySerial.write(0x82);
while (mySerial.available() < 1);
Serial.println(mySerial.read());
Serial.println("DONE");
}
void loop() {
// put your main code here, to run repeatedly:
}