小车的前进后退,左右转弯 代码如下 void motor(char pin,char pwmpin,char state,int val) { pinMode(pin, OUTPUT); ) { analogWrite(pwmpin,val); digitalWrite(pin,); } ) { analogWrite(pwmpin,val); digitalWrite(pin,); } ) { analogWrite(pwmpin,); digitalWrite(pin,); } } void…