16
Step motorni boshqarish uchun eskiz
// ULN2003 modulini Arduino ga ulash uchun portlar #define
in1 8
#define in2 9
#define in3 10
#define in4 11 int dl = 5; // impulslar orasidagi kechikish vaqti bekor o'rnatish
() {
pinMode (in1, OUTPUT );
pinMode (in2, OUTPUT );
pinMode (in3, OUTPUT );
pinMode (in4, OUTPUT );
} void loop () {
digitalWrite (in1, HIGH );
digitalWrite
(in2, LOW );
digitalWrite (in3, LOW );
digitalWrite (in4, HIGH );
kechikish (dl); digitalWrite (in1, HIGH );
digitalWrite (in2, HIGH );
digitalWrite (in3, LOW );
digitalWrite (in4, LOW );
kechikish (dl); digitalWrite (in1, LOW );
digitalWrite (in2, LOW );
digitalWrite (in3, HIGH );
digitalWrite (in4, HIGH );
kechikish (dl);
}
Dostları ilə paylaş: