Connecting Qik to Arduino to MATLAB

Hello,

I’m trying to create a robot controlled via a joystick or gamepad, so I want to be built off the Simulink platform because it has all the requisite plug-ins. I have an interface between MATLAB/Simulink and my Arduino, but it does not include the libraries that allow me to communicate with a Qik (I’m using a 2s12v10). My only idea is to translate the important parts of the Qik and SoftwareSerial Arduino libraries into MATLAB code. Any suggestions?

~ Tim

Hello, Tim.

Since you already have an interface between MATLAB and your Arduino, you might try having MATLAB send the serial commands to the qik through the Arduino without using the libraries. The serial commands for the qik can be found in the “Serial Commands” section of the qik 2s12v10 user’s guide.

- Jeremy

Hello,
My MATLAB library does not contain serial write code, so I’ll be putting that together myself. Do you know what I should use as the delay between bits when communicating with the Qik? Thanks.

~Tim

There should not be a delay between the bits. Also, you do not need to worry about adding extra delays between bytes. It might be possible to send enough commands in a row without delays to fill up the qik’s receive buffer, but it is not likely.

- Jeremy

Excellent, thanks. I’ll try to post my code as soon as I get it finished.

~Tim

Hello,

I finished developing a connection from MATLAB to an Arduino to a Qik 2s12v10. It is a modification of the original MATLAB srv.pde and arduino.m files. qiksrv.pde is run on the Arduino while arduinoQ objects are created and controlled through the MATLAB interface. The current .pde file is only designed to allow for turning motors on and off. I’ll post an updated version of the code as develop it further.

~Tim
ArduinoQ.txt (91.2 KB)
qiksrv.pde (27.2 KB)

Thanks for sharing! I am glad you got it working.

- Jeremy