View Full Version : need help Cm-510 roboplus task code

11-05-2012, 09:10 PM
Hello I am working on a Biped Mech. I have an airsoft gun mounted and thanks to
help from Jwatte and Tician the MOSFET circuit is ready to go. The progress can be viewed
in this thread (http://forums.trossenrobotics.com/showthread.php?5777-My-mech-build-have-a-Weapon). What I need help with is the Task code to control it. I spent
a lot of time today trying to research it and I can't figure it out. Here is what I am trying to do exactly :
Platform = Roboplus
Controller = CM-510
Port 1 Using Pin 1 (+5v out) and Pin 4 (GND)
I need code so when I push Button 6 on my robtis RC-100 Bioloid Boomerang Controller
the signal is sent to fire the airsoft. I know my way around motion files, but the task files look like
chinese to me. Thanks guys.

11-05-2012, 09:56 PM
The Robotis e-support site (http://support.robotis.com/en/) is very useful (Software Help -> RoboPlus -> RoboPlus Task). If you are building from a previous task file, there should be an endless loop with either a "conditional stand" along the lines of "wait while(Remocon Arrived == FALSE)" or a basic "if (Remocon Arrived == TRUE)" followed by "SOME_VARIABLE_NAME = RemoconRXD". This waits for a valid packet to arrive from the RC-100, or simply checks if one has arrived, before storing any new valid received data in a variable.

Each of the lower 10 bits of the 16-bit word received from the RC-100 represents a button on the RC-100 (bit-0 is UP, bit-1 is DOWN, etc.). Button 6 will be bit-10 and you can check to see if it has been pressed by doing a AND'ing it with the appropriate power of 2. RoboPlus makes it even easier by including the RC-100 button parameter as an option you can select from an image of the RC-100. Your code for checking if button 6 is pressed will essentially be two lines: "FIRE = Received_Data & Button-6" followed by "if (FIRE > 0)". The "Button-6" in the last sentence will be a little RC-100 icon followed by a "6". Inside the brackets of the if statement is where you will put the code to control the user pin. Another user was recently having trouble getting RoboPlus to properly control the pin, but it should follow this reference (http://support.robotis.com/en/product/bioloid/premiumkit/usefullinfo/cm-510_usersensor.htm).

When all buttons are released, the RC-100 sends one last packet with all zeros to let the user code know that it should probably stop if it hasn't already.

11-05-2012, 10:06 PM
Tician thanks again, I am studying that link now. I will post what I come up with. Going to experiment with it.