Hi,
I’m creating an extension to work with an arduino car in mBlock v3.4.11.
I have found I need an “h” block type with an cal to runArduino javascript function but everytime I block with this call, in Arduino extension, mBlock extension os my own extension, the following extra code is generated but I haven´t found this code in any extension.
How can I run my block code with out adding this extra code?
Thanks in advance,
Miguel
{{{
MeDCMotor motor_9(9);
MeDCMotor motor_10(10);
void move(int direction, int speed)
{
int leftSpeed = 0;
int rightSpeed = 0;
if(direction == 1){
leftSpeed = speed;
rightSpeed = speed;
}else if(direction == 2){
leftSpeed = -speed;
rightSpeed = -speed;
}else if(direction == 3){
leftSpeed = -speed;
rightSpeed = speed;
}else if(direction == 4){
leftSpeed = speed;
rightSpeed = -speed;
}
motor_9.run((9)==M1?-(leftSpeed):(leftSpeed));
motor_10.run((10)==M1?-(rightSpeed):(rightSpeed));
}
}}}