单词 | word |
---|---|
马达 | motor |
直流电 | direct current |
void setup(){
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
digitalWrite(13,HIGH);
digitalWrite(12,HIGH);
digitalWrite(11,HIGH);
digitalWrite(10,HIGH);
}
void loop(){
if (digitalRead(13) == 0) {
analogWrite(6,0);
} else if (digitalRead(12) == 1) {
analogWrite(6,100);
} else if (digitalRead(11) == 1) {
analogWrite(6,200);
} else if (digitalRead(10) == 1) {
analogWrite(6,255);
}
}