L293À» »ç¿ëÇÏ¿© 7~12VÀÇ DC ¸ðÅÍ Á¦¾î¸¦ ÇÒ ¼ö ÀÖ´Â ½¯µåÀÔ´Ï´Ù. ¾ÆµÎÀÌ³ë ¿ì³ë, µà¿¡¹Ð¶ó³ëºê, ¸Þ°¡¿¡ ³¢¿ö¼ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
Pin | Function |
---|
Digital 4 | Motor 2 Direction control | Digital 5 | Motor 2 PWM control | Digital 6 | Motor 1 PWM control | Digital 7 | Motor 1 Direction control |
À§¿Í °°ÀÌ ÇÉÀ» ¿¬°áÇÑ ÈÄ¿¡ ´ÙÀ½ÀÇ ¼Ò½ºÄڵ带 ¾÷·ÎµåÇÏ¿© »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
int EN1 = 6;
int EN2 = 5;
int IN1 = 7;
int IN2 = 4;
void Motor1( int pwm, boolean reverse)
{
analogWrite(EN1,pwm);
if (reverse)
{
digitalWrite(IN1,HIGH);
}
else
{
digitalWrite(IN1,LOW);
}
}
void Motor2( int pwm, boolean reverse)
{
analogWrite(EN2,pwm);
if (reverse)
{
digitalWrite(IN2,HIGH);
}
else
{
digitalWrite(IN2,LOW);
}
}
void setup()
{
int i;
for (i=4;i<=7;i++)
pinMode(i, OUTPUT);
Serial.begin(9600);
}
void loop()
{
int x,delay_en;
char val;
while (1)
{
val = Serial.read();
if (val!=-1)
{
switch (val)
{
case 'w' :
Motor1(100, true );
Motor2(100, true );
break ;
case 'x' :
Motor1(100, false );
Motor2(100, false );
break ;
case 'a' :
Motor1(100, false );
Motor2(100, true );
break ;
case 'd' :
Motor1(100, true );
Motor2(100, false );
break ;
case 's' :
Motor1(0, false );
Motor2(0, false );
break ;
}
}
}
}
INTRODUCTION
This Motor shield for
Arduino uses L293 chip which allow to drive two 7-12V DC motors with maximum 1A
current. This shield can be directly mount onto standard Arduino Duemilanove
and Arduino Mega.
SPECIFICATION
¡¤
2 way
7-12V motor drive
¡¤
Up to 1A
current each way
¡¤
PIN
4,5,6,7 are used to drive two DC motors
¡¤
Support
PWM speed control
DOCUMENTS
¡¤
Manual
SHIPPING
LIST
¡¤
1A Motor
Shield For Arduino x1
|