Hey,
I’m trying to control a servo motor (30 kg) and to make it spin 90 deg beck and forth.
And my servo keep spinning and doesn’t stop.
When i press the button in the blynk app it just stop and start again.
Please what shuld i do?
Try adding some serial print statements and you’ll have a better idea about what’s happening to your pos variavle when you do this…
and this…
Adding some Blynk.run() commands into your for loops (once you get them looping correctly) would help you avoid disconnections caused by your delays.
You may also want to add an if statement into your BLYNK_WRITE function which checks the value coming from the button widget so that it only operates on a press rather than a press and release.
I didn’t understand you for the second advise.
But for the first one, I’m receiving 1 2 3…90 89 88 87…1
but the servo is just keep spinning without control.
So i go to youtube and found a guy that explain how to control a servo motor.
i copied his code and did exactly what he said and no changes at all, the servo just keep spinning and spinning…
Hey Pete,
I’m really frustrated for now i just wont to move the servo 90 deg beck and forth.
i tried a lot of codes and changes and the motor doesn’t wont to listen to my codes.
maybe you can direct me to a tutorial that works 100% in that subject please.
My advice would be to stick with one sketch rather than keep chopping and changing.
Then, post your code, details of your hardware and connections, what you see in your serial monitor, what widgets you have set-up in your app and how they are configured, and details of EXACTLY what happens when you boot your device and when you operate the widget buttons.
ok i have some “good news” i tried a different code and now instead of choosing the angle I’m choosing the speed of the spin/ i make a slider 1-180, when 1 is the fastest spin clockwise and 90 the servo stop, 180 full speed in anticlockwise. the servo isnt stopping!!! in the video the servo stop!! maybe something changed in blynk setting through time? or what?
im using a 360 servo 30kg, and i think that this is the problam?
the code: