Microduino-Shield Robot/zh
(重定向自Microduino-Robot/zh)
Language | English |
---|
Microduino-Robot shield板子作为直流电机控制板, 配合Microduino-Core/zh、Microduino-Core+/zh可以控制4路直流电机。同时板载传感器接口,用户可接入各种传感器来实现更多的功能。
特色
规格
文档
开发直流电机接线将一个直流电机接(A.MOTOR.1),另外一个直流电机接(A.MOTOR.2); 或一个直流电机接(B.MOTOR.1),另外一个直流电机接(B.MOTOR.2); 直流电机控制方式
示例程序: //=========M.A=============//
int mic_left_A = 6;
int mic_right_A = 8;
int mic_head_A = 5;
int mic_back_A = 7;
//=========M.B=============//
/*
int mic_left_A = A0;
int mic_right_A =A1;
int mic_head_A = A2;
int mic_back_A = A3;
*/
void setup() {
pinMode(mic_left_A,OUTPUT);
pinMode(mic_right_A,OUTPUT);
pinMode(mic_head_A,OUTPUT);
pinMode(mic_back_A,OUTPUT);
}
void loop() {
head();
delay(1500);
back();
delay(1500);
left();
delay(1500);
right();
delay(1500);
}
void head()
{
digitalWrite(mic_left_A,LOW);
digitalWrite(mic_right_A,HIGH);
digitalWrite(mic_head_A,HIGH);
digitalWrite(mic_back_A,LOW);
}
void left()
{
digitalWrite(mic_left_A,HIGH);
digitalWrite(mic_right_A,LOW);
digitalWrite(mic_head_A,HIGH);
digitalWrite(mic_back_A,LOW );
}
void right()
{
digitalWrite(mic_left_A,LOW);
digitalWrite(mic_right_A,HIGH);
digitalWrite(mic_head_A,LOW);
digitalWrite(mic_back_A,HIGH);
}
void back()
{
digitalWrite(mic_left_A,HIGH);
digitalWrite(mic_right_A,LOW);
digitalWrite(mic_head_A,LOW);
digitalWrite(mic_back_A,HIGH);
}
void stoop()
{
digitalWrite(mic_left_A,LOW);
digitalWrite(mic_right_A,LOW);
digitalWrite(mic_head_A,LOW);
digitalWrite(mic_back_A,LOW);
}
应用开源电驱机器小车CUBE/zh购买历史图库
视频 |