Easy Pump arduino stepper

107 (likes)
6268 (views)
This product is available only if you have an account in My Mini Factory service
×
Color:

Easy pump with arduino and Stepper motor.https://youtu.be/dSlVYtNwtloi use: 6x bearings: 10x5x4 mmNEMA 17Stepper motor with 5mm shaftsteper driver pololu A4988Arduino Nanorezistor 10kswitchsilicone pipe 5x3mmsome screws M3,M2 and nuts arduio code:int x;const int buttonPin = 2;int buttonState = 0; void setup(){pinMode(6, OUTPUT); // EnablepinMode(5, OUTPUT); // SteppinMode(4, OUTPUT); // DirdigitalWrite(6, LOW); // Set Enable lowpinMode(buttonPin, INPUT);Serial.begin(9600); } void loop(){buttonState = digitalRead(buttonPin); Serial.println(buttonState); if (buttonState == HIGH) { digitalWrite(6, LOW); // Set Enable lowdigitalWrite(4, HIGH); // Set Dir high for (x = 0; x < 4000; x++) // Loop 200 times{ digitalWrite(5, HIGH); // Output high delayMicroseconds(300); // Wait 1/2 a ms digitalWrite(5, LOW); // Output low delayMicroseconds(300); // Wait 1/2 a ms}delay(1000); // pause one second}else { digitalWrite(6, HIGH); // Set Enable low } }

Author:
mochr

Reviews

This model have no reviews. Would you like to be the first to review? You need to print it first.