Ardublock servo port# and slot#?


#1

When I use the servo motor block in Ardublock, there is an input for port# and slot# and I am not sure how this correlates to the pins of my Arduino chip. For example, I am trying to control a servo that is attached to pin 7 to do simple movements. I figured I should use PORT 7 and SLOT 1 but it does not work. I then looked into the code produced by ardublock:

Servo servoDriver7;

void setup()
{
int pinName = mePort[7].s1;
servoDriver7.attach(pinName);
}

void loop()
{
servoDriver7.write(90);
delay( 2000 );
servoDriver7.write(45);
delay( 2000 );
}
I am not sure what mePort[7].s1 is but I know that the controls work if i replace that with
int pinName = 7;
servoDriver7.attach(pinName);
Does anyone know how to get the ports to work with my chip? I do not want to change pinName in the code everytime I use ardublock when I go into more complicated projects. I am using an Arduino mini pro if that helps.


#2

Hi walkingrobot,

The port# and slot# in Ardublock is developed for the Baseboard of Makeblock, you could visit here to get the relationship between Arduino pin# and Baseboard port#.

http://learn.makeblock.cc/me-baseboard/


#3