Stepper motor and esp-01

I want to use an esp-01 and a mega arduino to control a stepper motor (28byj-48 + ULN2003) that at blynk will activate when I press a button on the mobile app, or it will activate when the time is determined (using an RTC ds3231 as a reference) that I I also have to put it in the code through the app, and I want that through a module hx711 + load cell, the scale is indicated in the app Having said that and taking into account that I don’t understand programming well, my question more specifically in this topic is: how to put the activate part by the button? (but I accept help with the rest of the project too)
my code by now is

#include <Stepper.h>

#define e1 8
#define e2 8
#define e3 9
#define e4 11
 const int passosPorGiro=64;

 Stepper mp(passosPorGiro,e1,e2,e3,e4);

 void setup(){
void loop() {
 for(int i=0;i<64;i++){

That’s goi8ng top be a problem, as working within stepper motors in Blynk isn’t easy. Steppers are very fussy about timing, and so is Blynk.

Your void loop is currently incompatible with Blynk, for a number of reasons, but mainly because of the blocking delay.
You should read this:

I’d suggest that you search the forum for other examples of working projects which use stepper motors and start by experimenting with and modifying those. You can then go on to adding in the HX711 code.

You’re probably on your own with this, as its very unlikely that other forum members will have the same hardware kicking around to test code with, so any advice you get will require you to run with it and turn it into a finished solution - which requires a reasonable level of coding ability.


1 Like