I currently have a function in matlab that reads data from a sensor connected to my computer and then sends motor commands to the motors via serial connection. I am trying to make this serial connection wireless using an arduino uno board and 2 XBee chips. The motor encoders take ascii commands (i.e. you send ‘en’ to enable and ‘v100’ to command 100 rpm). I have the XBee’s programmed to be communicate with each other. The code below is what I have downloaded to my Arduino Uno board. I have my Uno/Xbee combo connected to my motors and the second XBee connected via USB to my computer. However, if I try to run my Matlab program, nothing happens. Do I have my Arduino code correctly setup to run this type of system? Also, I can only upload the Arduino code to the Uno if I do not have the XBee attached, if that’s of any importance. Any help would be appreciated. Thanks.
SoftwareSerial mySerial(10, 11); // RX, TX