Hi guys,
I succesfully connected the Meccanoid servos to Arduino. It appeared to be not hard at all. I used Arduino Mega and Sensor Shield.
The only problem is to find appropriate connectors. Meccanoids battery has Mini-Tamiya female connector. So you need to buy one Mini-Tamiya male at a hobby RC cars store, it is quite common.
Motors are plugged differently, so you need to buy at a local electronics store 2 different male connectors: one is CWF-2 (it is called so in Russia, a small white one), and another one I cannot figure out, so I used simply PLS-2, it fits. Tomorrow I am going to try try my good old Motor Shield to drive his DC motors, and after that I write a complete tutorial.
What I liked that fully charged Meccanoid battery gives you about 7V, so I didn't use any voltage converter, I simply plugged it into Arduino's VIN.
I think that for simplicity, to control Meccanoid via Arduino you need to choose a one-board like DFRduino Romeo, which already has servo pins and motor driver. I am going to give it a try. But if you don't have any, you can simply use Arduino + motor shield.
Here is my test code, it works with 4 servos plugged into each other. I tried it on Arduino Mega, but you may use Uno and any other Arduino which has PWM ports:
#include <MeccaBrain.h>
//for Uno and like
/*
const int pwmPin1=9;
const int pwmPin2=10;
const int pwmPin3=11;
*/
//for Mega and like
const int pwmPin1=44;
const int pwmPin2=45;
const int pwmPin3=46;
MeccaBrain chain1(pwmPin1); //each chain allows to plug up to 4 smart modules
MeccaBrain chain2(pwmPin2);
MeccaBrain chain3(pwmPin3);
void setup() {
}
void loop() {
chain1.setServoPosition(0, 0);
chain1.communicate();
delay(1000);
chain1.setServoPosition(0, 255);
chain1.communicate();
delay(1000);
chain1.setServoPosition(1, 0);
chain1.communicate();
delay(1000);
chain1.setServoPosition(1, 255);
chain1.communicate();
delay(1000);
chain1.setServoPosition(2, 0);
chain1.communicate();
delay(1000);
chain1.setServoPosition(2, 255);
chain1.communicate();
delay(1000);
chain1.setServoPosition(3, 0);
chain1.communicate();
delay(1000);
chain1.setServoPosition(3, 255);
chain1.communicate();
delay(1000);
}