Manual
23 | P a g e
analogWrite (EN1, LOW); // set low, miniQ stop
else
analogWrite (EN1, M1_EN); // Otherwise, set the corresponding value
/////////// M2 //////////////////////
if (M2_DIR == FORW) // M2 motor direction
digitalWrite (IN2, FORW); // set high, the direction of forward
else
digitalWrite (IN2, BACK); // set low, the direction of backward
if (M2_EN == 0) // M2 motor speed
analogWrite (EN2, LOW); // set low, to stop
else
analogWrite (EN2, M2_EN); // set the value for a given
}
IR Remote Control
/*
4WD kit
author:Lauren
version:0.1
date:2011.12.6
Function:
IR remote control 4wd robot
*/
int E1 = 5; //M1 Speed Control
int E2 = 6; //M2 Speed Control
int M1 = 4; //M1 Direction Control
int M2 = 7; //M1 Direction Control
#include <Metro.h>