Hi, I'm very new here

After upload MrlComm example using MrlComm.h library  to my arduino mega

#include <Servo.h>
#include<MRLComm.h>
 
 
MRLComm mrl = MRLComm();
 
void setup() {
 
    Serial.begin(57600);
    mrl.setup(&Serial);
}
 
void loop() {
 
  // process mrl commands
  // servo control, sensor, control send & recieve
  // oscope, analog polling, digital polling etc..
  // mrl messages
  mrl.process();
 
  // example how to
  // send 3 vars to mrl
  /*
  int ax = 28;
  int ay = 583;
  int az = 32767;
 
  mrl.startMsg();
  mrl.append(ax);
  mrl.append(ay);
  mrl.append(az);
  mrl.sendMsg();
  */
 
}

Then I open python service in MRL and type some command like

arduino=Runtime.createAndStart("arduino","Arduino")
arduino.addCustomMsgListener(python)

I received an error:

 addCustomMsgListener(): 1st arg cant be coerced to org.myrobotlab.service.interfaces.CustomMsgListener It seem like MrlComm no longer in use 

Mats

8 years 8 months ago

Hi

To make it work you need to install the whole MRLComm program to the Arduino.

The program in the Arduino communicates with the Arduino service in MyRobotlab using serial commands. So they need to be in sync. The load of MRLComm that I describe below are only neccesary to do the first time and when there is a new version of MRLComm available.

1. Start MyRobotLab.

2. Klick on the runtime tab.

3. Rightclick on the Arduino service and select start.

4. Type Arduino in the "new service name" box.

5. Now you will get two new tabs, "Arduino" and Ardino.serial. If you don't see them, then change the size of the window to refresh it.

6. Klick on the "Arduino" tab to select it.

7. Select and copy the complete code to the cliboard ( i.e <ctrl>A, <ctrl>C )

8. Close MyRobotLab.

9. Start the Arduino compiler / loader. Paste the complete code into the sketch window.

10. Make sure that you select the correct Board and Serial port.

11. Verify and upload the sketch to your Ardino Mega.

12. Close the Arduino compiler / loader.

13. Start MyRobotLab.

14. Repeat steps 2-4.

15. Klick the "Arduino.serial" tab to select it.

16. Select the port that your Arduino is connected to.

17. The Arduino should respond with "connected Arduino.serial responded version 27 ... goodtimes ....

Now the Arduino is ready to be used. 

For example you can use this little Python script to test to blink the LED on pin 13 

https://github.com/MyRobotLab/pyrobotlab/blob/master/home/Mats/ArduinoB…