Arduino control speed


#1

hi
I buy a me 130 dc motor
http://store.makeblock.com/me-130-motor-pack-5v-10000rpm

I write this sketch to control it

#include “MeAuriga.h”

MePort fanout(PORT_3);
MePort fanin(PORT_3);

void setup()
{
Serial.begin(115200);
Serial.setTimeout( 100 );
}

void loop()
{
//Read serial commands.
while ( Serial.peek() != -1 )
{
//Read 3 character command.
char cmd[4] = “—”;
Serial.readBytes( cmd, 3 );
Serial.print(cmd);
//Execute chosen command.
if ( strcmp( cmd, “fan” ) == 0 ) fanout.dWrite1(LOW);
if ( strcmp( cmd, “stp” ) == 0 ) fanout.dWrite1(HIGH);

}
}
can you tell me how can I had a speed control, please?


#2

The me 130 dc motor doesn’t support speed control since there is no need for motor driver when connect it to the Makeblock mainboard.


#3

ok thanks for your time


#4