求助一个两相四线步进电机的51程序
RT,能转就行,不用太复杂{:soso__10615784733045253186_1:} 本帖最后由 マイナス37度 于 2016-11-17 15:29 编辑digitalWrite(pul, HIGH);
delayMicroseconds(速度);
digitalWrite(pul, LOW);
delayMicroseconds(速度);
这样看得懂么?pul=脉冲,delayMicroseconds延时越短速度越快 マイナス37度 发表于 2016-11-17 15:24
digitalWrite(pul, HIGH);
delayMicroseconds(速度);
digitalWrite(pul, LOW);
求一个完整的程序 本帖最后由 マイナス37度 于 2016-11-17 21:06 编辑
Vincent6 发表于 2016-11-17 16:21
求一个完整的程序
void setup() {
pinMode(13, OUTPUT);
//pinMode(12, OUTPUT);
//digitalWrite(13, HIGH);
//Serial.begin(9600);
}
void loop() {
digitalWrite(13, HIGH);
delayMicroseconds(2000);
digitalWrite(13, LOW);
delayMicroseconds(2000);
}
脉冲+接13,脉冲-接gnd
额额,不好意思,看错了,这个不是51的代码,道理是一样的,让51产生一个脉冲 大神,能不能请教一下控制步进电机做X轴,Y轴运动,最终化成一个圆的代码。
页:
[1]