|
本帖最后由 Jackxwb 于 2016-4-9 14:32 编辑
网上找到的都是 L298 的教程,或是四个接线的教程。可是这个L9110S芯片的电机模块(https://item.taobao.com/item.htm?spm=a1z09.2.0.0.1akJv8&id=43812224258&_u=82gj6r6o3f7f )只有两个控制引脚,卖家给出的例程也是C51的。
而自己写的代码完全无反应[6、7脚接IA2、IA1,vcc、gnd接外部电源(移动电源5v)] - int zs;
- void setup() {
- // put your setup code here, to run once:
- pinMode(6,OUTPUT);
- pinMode(7,OUTPUT);
- Serial.begin(9600);
- digitalWrite(6,HIGH);
- digitalWrite(7,LOW);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- analogWrite(7, zs);
- zs++;
- Serial.println(zs);
- if(zs>=1024)
- zs=0;
- delay(10);
- }
复制代码
C51例子http://pan.baidu.com/share/link?shareid=1359713279&uk=590225187 求翻译 |
|