º» Á¦Ç°Àº 4°³ÀÇ DC ¸ðÅ͸¦ µ¿½Ã¿¡ Á¦¾îÇÒ ¼ö ÀÖ´Â Á¦Ç°À¸·Î ¾ÆµÎÀ̳뿡 ÀûÃþÇؼ »ç¿ëÇÒ ¼ö ÀÖ´Â ½¯µåÇüÅÂÀÔ´Ï´Ù. 2.5~13.5V ¸ðÅ͸¦ ±¸µ¿ °¡´ÉÇÕ´Ï´Ù. ÃÖ´ë 1.2A ¿¬¼ÓÀ¸·Î Àü·ù¸¦ º¸³¾ ¼ö ÀÖÀ¸¸ç, ¾ÆµÎÀ̳ëÀÇ µðÁöÅÐ ÇÉ 3, 4, 5, 6, 7, 8, 11, 12¹øÀ» »ç¿ëÇÏ°í ÀÖ½À´Ï´Ù.
Motor | Direction | Forward | Backward | Speed | Speed range | M1 | 4 | LOW | HIGH | 3 | 0-255 | M2 | 12 | HIGH | LOW | 11 | 0-255 | M3 | 8 | LOW | HIGH | 5 | 0-255 | M4 | 7 | HIGH | LOW | 6 | 0-255
|
¾ÆµÎÀÌ³ë »ùÇà ÄÚµå const int E1 = 3;
const int E2 = 11;
const int E3 = 5;
const int E4 = 6;
const int M1 = 4;
const int M2 = 12;
const int M3 = 8;
const int M4 = 7;
void M1_advance( char Speed)
{
digitalWrite(M1,LOW);
analogWrite(E1,Speed);
}
void M2_advance( char Speed)
{
digitalWrite(M2,HIGH);
analogWrite(E2,Speed);
}
void M3_advance( char Speed)
{
digitalWrite(M3,LOW);
analogWrite(E3,Speed);
}
void M4_advance( char Speed)
{
digitalWrite(M4,HIGH);
analogWrite(E4,Speed);
}
void M1_back( char Speed)
{
digitalWrite(M1,HIGH);
analogWrite(E1,Speed);
}
void M2_back( char Speed)
{
digitalWrite(M2,LOW);
analogWrite(E2,Speed);
}
void M3_back( char Speed)
{
digitalWrite(M3,HIGH);
analogWrite(E3,Speed);
}
void M4_back( char Speed)
{
digitalWrite(M4,LOW);
analogWrite(E4,Speed);
}
void setup() {
for ( int i=3;i<9;i++)
pinMode(i,OUTPUT);
for ( int i=11;i<13;i++)
pinMode(i,OUTPUT);
}
void loop() {
M1_advance(100);
M2_advance(100);
M3_advance(100);
M4_advance(100);
delay(2000);
M1_back(100);
M2_back(100);
M3_back(100);
M4_back(100);
delay(2000);
}
|
|