Arduino Tutorial 35: Understanding How to Use a Stepper Motor

Поделиться
HTML-код
  • Опубликовано: 11 июн 2024
  • You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
    / paulmcwhorter
    In this lesson we show you how you can control a stepper motor using the Arduino. We show how to operate the motor in both directions and how to control the speed.
    You can get the kit I am using for this series at the following link:
    amzn.to/2I7N4Ek
    Follow these lessons on our WEB site:
    toptechboy.com/arduino-tutori...
    [Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. This means if you visit the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers.]
    #Arduino
  • НаукаНаука

Комментарии • 991

  • @thomasmiller3398
    @thomasmiller3398 2 года назад +55

    Currently in my second year of aerospace engineering at university and have never touched an Arduino or C++ before and was given a project requiring the use of multiple stepper motors, sensors, buttons and LEDS and I cannot stress enough how much these videos have helped me. Thank you so much for making such high quality free material! I know there will be others like me in similar situations and your videos will have saved them as much as me.

    • @zvone908
      @zvone908 7 месяцев назад +2

      Hi, I'm thinking about studying aerospace engineering after high school. Can you recommend any books worth reading, or give any advice other than that?
      Thanks in advance :)

  • @Seftdelmer
    @Seftdelmer 2 года назад +19

    For those that are doing this with the kit, please note that the supplied 9V battery may not be sufficient to drive the stepper motor (via the driver). When I first tried with the supplied battery, the stepper motor made a noise but didn't turn. I then swapped the supplied battery with a new one, and the stepper motor turned. Thanks to Paul for these excellent videos.

    • @sebastiannunez4878
      @sebastiannunez4878 Год назад +1

      was the new battery any different?

    • @AlexDavis-ch1ro
      @AlexDavis-ch1ro Год назад +2

      Yep, me too. Mine came with a Piscell 9V: obviously not up to the task. Energiser did the trick!

    • @Lucky-ek8tv
      @Lucky-ek8tv Год назад +2

      same

    • @Thejbelow
      @Thejbelow 11 месяцев назад +2

      Even with a brand new battery it's weak. Can't beat a power supply

  • @JonPeroutka
    @JonPeroutka 2 года назад +27

    You, sir, are the Bob Ross of engineering. Thank you for your great tutorials.

  • @peterknoll8906
    @peterknoll8906 2 месяца назад +2

    I know it's an old video. I don't know if you read the comments here.
    I did the homework as you said, without having seen your solution to that.
    I did a attach.Interrupt and with it i called a function "reverse", ive made.
    In this function, i reversed direction.
    My quick and dirty way of spinning infinitely in the main loop, was to start of with "while (true)"
    It's at least a very short code, by having the same outcome.
    I've did a INPUT_PULLUP command on the pinmode. That works great.
    Thank you Sir, for your educational videos.
    Ive learnt a lot from you!

  • @mxcollin95
    @mxcollin95 4 года назад +142

    This channel is a gold mine! I’ll definitely be working through your arduino and RasPi series!!! Wish I would’ve had a teacher like you when I was in high school. 👍

  • @bjornakeSwe
    @bjornakeSwe 3 года назад +6

    I'm a retired swede of 71. I've been an engineer for 50 years. My first experiece with computers was my Commodore 128 and Basic. I do remember the com speed of 9600 and sometimes even 2400. After that it has mostly been hardware. I discovered the Arduino and got interested. I stumbled on your videos and was hooked. After watching a number of them I realised I had to get the Super Duper Kit. So it is ordered but not yet received. So far i've watched your videos to the end, but programming them in my head, so when I get my kit I think I must start from scratch and do it irl. I've also noted that you have videos about RasPi and Python, so I don't need to be bored for a long time. I have a number of ideas that can be solved with the Arduino and some coding instead of a bunch of CMOS/TTL IC's. Like so many others in these comments i wish I had a teacher like you at school.

  • @MatlasX
    @MatlasX 4 года назад +115

    This is definitely one of the lessons where you could have probably spent a bit more time explaining how the stepper motor works in this particular case. Pins 8, 9, 10 and 11 were used, but really not sure what they do.

    • @misterdecaro
      @misterdecaro 2 года назад +4

      I agree, I'd like to know more details about why those specific pins and why the order of pins 9 and 10 are swapped in the Stepper setup call.

    • @jafaralturfy5053
      @jafaralturfy5053 2 года назад +11

      The stepper motor has 4 coils each coil is connected to 5v through these pins.

    • @syedsajjadali4220
      @syedsajjadali4220 2 года назад +3

      @@jafaralturfy5053 thanks mate

    • @chadmorreale
      @chadmorreale Год назад +3

      @@misterdecaro I believe this is just due to the ribbon cable and wanting to put them in order physically on the connectors.

    • @davidransier
      @davidransier Год назад +6

      OK, not so sure this comment will be helpful, but here goes. I read the Documents included with the Elegoo kit and it says the four pins are a four-bit code to the stepper. That says to me that they should be in order. I confirmed this by reading the Stepper.h file (found in Github). However, when I put the in numerical order the motor only spins one direction, regardless of the Step value. When I SWAP PINS 9 7 10, the direction swaps correctly when I push the button. Bottom line, we need more info from Paul M!

  • @sampleexamplemusic
    @sampleexamplemusic 3 года назад +9

    GIDDY UP. ok this dude rules. going back to the beginning and watching all of these because he's an awesome teacher!

  • @stefstaf
    @stefstaf 4 года назад +6

    These are invaluable lessons and thank you Mr. McWhorter for taking the time (and the pain) to make them for our benefit. The synchronus presentation of the code, the printout and the experiment makes these lessons the best you can find in the subject. I had a little difficulty understanding the stepper commands that came out of nowhere but then I realized that these commands are hidden in the accompanying libraries. If you intend to devote one of your wonderful lessons in explaining Arduino librabries and how they "generate" the new commands we would be for ever grateful sir.

  • @bm5211
    @bm5211 4 года назад +18

    Thank you so much for these wonderful tutorials! As an ecology student, I have never in my life touched anything to do with electronics or mechanics before watching your Arduino series. But now, 35 episodes later, I am amazed to say I can still follow along with everything. :) Every time you introduce a new part I get so many ideas for hobby projects! I genuinely never thought I would be able to understand anything to do with wires and circuits, but your explanations have made the impossible possible. Thanks again, you're the best!

  • @TheSelfUnemployed
    @TheSelfUnemployed 2 года назад +8

    Unable to complete the homework on my own but grateful for the lesson! Thank you Paul!

  • @misterdecaro
    @misterdecaro 2 года назад +4

    Before watching this, I just want to say that I wasn't sure if I was going to 'bother' going back to watch you first series, your 'lessons' on Adruino. But now I can say that I will definitely go and watch them also! I was looking for something specific and I found it in one of the lessons and, I have watched a couple of others too! At any rate, to my fellow followers/subscribers/learners, the first set of lessons Paul offered is definitely worth your time and effort. Thank you Mr. McWhorter!

  • @sandeepjadhav3565
    @sandeepjadhav3565 4 года назад +10

    I am following you since lesson 1, and i would like to say I was able to do homework on my own. thanks to you.

  • @rogthedodge99
    @rogthedodge99 3 года назад +3

    I did it using lesson 28 as a base. My motor only reversed when it had reached 1 revolution because I'd left
    the number of steps at 2048. My stepper direction was based on the button val. I now realise you can step 1 at a time, and in the same direction until told otherwise. Thanks Paul. It really is worth trying things yourself first, even if it's not quite right.

  • @gusmon83
    @gusmon83 2 года назад +2

    That last bit there put into the void loop threw my brain a curveball. Finally figured out it was "buttonValOld=buttonValNew;" as the last line of the void loop. Paul, I've been bingeing these lessons and crushed 35 in three days. You've done an incredible job, here. I knew nothing but was able to follow until you said "pause" AND THEN able to program this in my own way, unfortunately vastly different and of course with different results than you were able to provide here. Things happened, but it was still on delay and made a full rotation and then reversed. Invaluable lessons. THANK YOU!

  • @donthomas9669
    @donthomas9669 4 года назад +1

    I got it on my OWN!!! My confidence is growing!! Thank you so much Paul, you are an excellent teacher, and the best part of my day is coming home and doing these arduino tutorials with you, I look forward to them all day long. I used an if else statement, with a button value variable and a digitalRead command making the button HIGH with a digitalWrite command.I didnt even use buttonValNew or buttonValOld, I just used button val and I used If(buttonvalue==0) then the stepper commands, then else (buttonvalue==1) then the negative stepper commands.

  • @donaldtroll7537
    @donaldtroll7537 3 года назад +12

    The battery from the kit died within a few minutes and made me think I unplugged something. Plugged in a new battery and everything worked. Another great video, Paul.

    • @kenmeyer100
      @kenmeyer100 3 года назад

      same here. Luckily I found the culprit with a voltmeter

  • @christopherchance4860
    @christopherchance4860 4 года назад +3

    Where were you when I was in High School?
    Thank you for your enduring hard work, I have learned so much from you and your tutorials

  • @ancienttechnologiespinball1690
    @ancienttechnologiespinball1690 4 месяца назад

    Hello Paul.
    I'm an Electric Mechanical pinball technician from Toronto, Canada. I built a pinball machine using parts from the '70s, but for mass production i need to use Solid State Electrictronics. That's why I'm here.
    Yes, i watch every video to the end, more than once. I take screen shots of coding and try not to look at the pictures later, but normally need to because I'm still learning the language. Same with the math. I failed math in high school and happy to learn it now.
    The wiring comes naturally to me. i've always been good with electricity and mechanical thing.
    I find no part of videos boring . Thank you for making them.
    My board broke down this morning, so while I'm waiting for a new one, I'm gonna start watching again from episode 1 and see if i can call the shots before you make them.

  • @bobpattenden
    @bobpattenden 9 месяцев назад

    This is my favourite lesson so far, so much of what has been taught over the past few lessons, all came together and made perfect sense.

  • @tretty07
    @tretty07 3 года назад +6

    Racked my brains for a couple of hours trying this one, I got it to change direction but only after each full turn, excellent lesson, learning something new each time.

    • @3dpprofessor
      @3dpprofessor 2 года назад

      Sorry, super late reply, but decrease the amount of steps between each check. Heck, you can have it check after every 1 step.

  • @Panvil
    @Panvil 3 года назад +3

    I did it on my own, but made it way too complex. Thanks for the great lesson Paul. Much love.

  • @chrisortilla6111
    @chrisortilla6111 Год назад +1

    I have just been copying you as you go because, I've picked up the lessons again after some time away. Trying to let my brain get refreshed! Thanks for another great tutorial.

  • @flyboypat
    @flyboypat 2 года назад

    ordered my kit finally, with your link. I have a different kit that doesn't have all the same components. This is a great series. Thanks for taking your time Paul.

  • @miketurley9277
    @miketurley9277 3 года назад +3

    Hello Paul, I appreciate your lessons. You have inspired me to learn this stuff in sequence not just dig around for what I am looking for. The kit definitely makes this easier than digging through my junk. I hate digging!
    I wanted to share a bit of my own knowledge with you.
    Although there may have been another comment or possibly just messing with some of the electronics newbies but either way ROHS isn't the MFR (I beleive this device is from Kiatronics). of the motor it is a qualification for hazardous materials used in the manufacturing process of stuff, usually electronic components. ROHS compliance was a standard that started in the late 90s-early 2000s. I hated the PB free solder, it just doesn't flow like the old stuff...

  • @CarolinaDGF
    @CarolinaDGF 2 года назад +4

    Thanks to all the instruction leading up to this video, I was able to do it on my own. You are a great teacher, Paul. The only thing I struggled with was getting the first part to work at all. As soon as I would plug in the stepper controller, the light would go out on my power supply. Turns out the battery in the kit did not have enough power. Glad I ordered a 9V Arduino wall wart when I ordered my kit. Plugged it in and all was well. (All was well after spending several minutes checking my wiring before pulling out my volt meter to see what the battery was not putting out enough power....)

    • @arjodas
      @arjodas 2 года назад

      thanks man I think I have the same issue lol

    • @pointer333
      @pointer333 2 года назад

      I'm glad I found this comment so I didn't have to pull out my meter lol! Had a rechargeable lithium 9V laying around from my pro sound work and everything is working now! Man, the brand new provided battery lasted about 30 seconds hahah!

    • @stevenog
      @stevenog Год назад

      Same problem here, no name batts are notorious for being junk. The updated link leads to a larger kit (The Most Complete Starter Kit) which includes many more parts (twice the price) including the wall wart.

  • @ghaniyyahmbello4393
    @ghaniyyahmbello4393 9 месяцев назад +2

    Mr Paul, your tutorials are really interesting and educative, breaking down every little detail. Thumbs up for the good job.

  • @paulorobertoevangelista7120
    @paulorobertoevangelista7120 4 года назад +1

    I really enjoeyd this class! My first try at programming alone, not just copyng!Thank you very much!

  • @karelenmarritkruyswijk393
    @karelenmarritkruyswijk393 4 года назад +9

    Who wouldn't get exited for electonics looking at these video's... Thank you. Thinking about using the stepper motor for domotica opening and closing curtains depending on time of the day if possible.

    • @TheRaptor1967
      @TheRaptor1967 3 года назад

      could use in conjunction with the light sensor. Auto Open curtains in the morning, close in the evening. Good security gadget for when your away?
      Would need to pick values carefully, would give the game away if they kept closing when a large cloud obstructed the light. :)

  • @27prajjwalprasad43
    @27prajjwalprasad43 4 года назад +3

    I did it on my own but in a muuuuuch more complex way. I was shocked to see that you made it work in just 5-6 lines of code!!!

    • @sreerajguptays3531
      @sreerajguptays3531 2 года назад

      Hi could you please send me your work to wrekjohn@gmail.com

  • @wayneandersen7596
    @wayneandersen7596 3 года назад +1

    I did it. I only had a couple of differences. I did 10 steps per loop and I changed direction on button release instead of button push. Thanks for doing this series!

  • @filipegameiro4344
    @filipegameiro4344 10 месяцев назад +1

    I was able to do it. And I really want to thank you for your work, it's the first time I can do something only with lessons given on youtube.

  • @satisfactoyz
    @satisfactoyz 3 года назад +3

    I wasn't able to figure it out, sad to say. I made it switch, but only after each command cycle finished. I didn't realize you could get continuous movement by multiplying by 1 and -1. Anyway .... it was an eye opener. Thanks again, Paul.

  • @dash8944
    @dash8944 3 года назад +3

    If any of you are having issues getting the stepper motor to rotate, try swapping batteries - the one that came with the kit didn't work for me.
    My motor was vibrating but not rotating (the LED lights were not coming on either).
    Hope you find this friendly advice helpful.
    (Thanks Paul for your amazing videos btw)

  • @leokim6831
    @leokim6831 4 года назад +1

    This is the best channel on youtube I hope that I have a teacher like you in my school

  • @keyboardlearning7552
    @keyboardlearning7552 2 года назад +1

    I'm a retired electrical engineer, following your videos for the fun of making a device follow the projects. I made this work, in a similar manner to how you taught us to toggle with the buttons. That was more elegant than my last attempt. (Sorry I haven't waited to get to the end of the video to get the magic word.)

  • @jefejc
    @jefejc 3 года назад +3

    These lessons are making me think hard but that's good for my old age

  • @lordstelanthin
    @lordstelanthin 3 года назад +21

    I did this one on my own, but wow did I overcomplicate it.

  • @philnewman1110
    @philnewman1110 Год назад +1

    This is just a brilliant series Paul, I am having so much fun learning this stuff. Thank you so much!

  • @ericroque5813
    @ericroque5813 2 месяца назад +1

    For those who had trouble doing this, take note of the right sequence of pin declaration which is 8, 10, 9, 11 as this is the right sequence for half step. I put the pin number in ascending order thinking it was just as simple as naming the pin number as I plug it in the arduino board. But no, the right order mattered. Took me a while to figure this out.

  • @michaelcostello6991
    @michaelcostello6991 4 года назад +24

    My battery died almost immediately. Lucky you warned us so we didnt panic and measured the voltage to confirm.

    • @jimmyjimmereeno3341
      @jimmyjimmereeno3341 3 года назад +3

      Same here. The low-cost battery that comes with the kit lasted less than 5 minutes. I was afraid that the motor or driver board had fried.

    • @christianvanderniet
      @christianvanderniet 2 года назад

      @@jimmyjimmereeno3341 yup i had the same exact thing the battery went out so i hooked up a extarnal power suply that can go to the net

  • @pranavshool
    @pranavshool 3 года назад +3

    Yeah, I did it by using different logic!

  • @grafophone
    @grafophone 3 года назад

    I enjoy all tutorials and will keep on doing as well as I can homeworks. I haven't succeeded the program. It's nice to "see" what's going on at pin 8, 9, 10, 11 with oscilloscope and see nice square waves. You're the teacher I needed when I was at high school 55 years ago. Thanks for all.

  • @karansunar4458
    @karansunar4458 3 года назад +1

    you are the best teacher i ever seen my life...

  • @gitarlos
    @gitarlos 4 года назад +23

    the elgo driver does not work some times unless you switch IN1 with IN4 .

    • @shatann
      @shatann 4 года назад +2

      That's right! How'd you figure that out?

    • @thomaseardley2900
      @thomaseardley2900 4 года назад +1

      thank you bro you saved me hours of trouble shooting

    • @godwincornelius6285
      @godwincornelius6285 3 года назад +2

      Wow what a life saver..... I wish Paul would have mentioned that... Thanks a lot by the way.... Because the stepper motor was misbehaving

    • @leonhardeuler8457
      @leonhardeuler8457 3 года назад

      Well it didn't work too

    • @leonhardeuler8457
      @leonhardeuler8457 3 года назад

      Don't do this it may damage ur driver
      Mine didn't work too and I used ur method and it worked but when I changed the code to stepsperrevolution/2 it didn't work
      Instead of doing that change ur battery my problem was battery

  • @MahBor
    @MahBor 3 года назад +4

    When the stepper motor starts moving, some components on my breadboard power supply module start heating up to the point where they burn my fingers if I touch them. Is this normal? I'm really worried and don't wanna burn my module so I've stopped using the stepper motor.

    • @khaledalaryani776
      @khaledalaryani776 3 года назад

      You are probably running more current in the components that you should be doing and that is why it’s heating up

  • @cbrombaugh
    @cbrombaugh 3 года назад

    I did it . We are still learning from your lessons. Keep it up Paul!

  • @kuravani1963
    @kuravani1963 4 года назад

    Thanks Paul. this lesson helps a lot to my ongoing cloth hanger project by using nema17 stepper motor with easy driver.

  • @KisorcererAMP
    @KisorcererAMP 4 года назад +9

    For the life of me, I could not understand this one. I've rewatched the toggle video multiple times and it seems that when a project involves toggles I struggle.

    • @garysenier2440
      @garysenier2440 4 года назад +1

      me too

    • @favesongslist
      @favesongslist 4 года назад +1

      You could try using two buttons for now to prove the stepper motor sketch, one for clockwise and one for anticlockwise, and then go back to the earlier tutorial for making a toggle work.

    • @favesongslist
      @favesongslist 4 года назад +1

      ​@@garysenier2440 the trick to understanding the toggle function is that you are detecting the button change from 0 (not pressed) to 1 (pressed) over time.
      So
      step1: read the button, if 0 then lastPress=FALSE
      step2: read the button again and if lastpress==FALSE and the Button is 1 change lastPress=TRUE; to Make sure the toggle only happens once per press.
      change the Toggle state, if it was 0 make it 1, or if it was 1 make it 0.
      Instead of using an int it may help to use a boolean (can be either 0 or 1)
      bool toggleState=0;
      int lastPress;
      int buttonVal;
      buttonVal=digitalRead(buttonPin);
      IF (buttonVal==0){ // Checks if button not pressed
      lastPress=0; // this makes sure the toggle next press
      }
      ELSE { // Do this when button is pressed
      IF (lastPress==0 ) { // Check for only once per button press
      lastPress=1; // stops repeating while button still pressed
      toggleState=!toggleState;
      digitalWrite(LEDpin, toggleState);
      }
      }

    • @karamyounis15
      @karamyounis15 4 года назад +1

      Hey, idk if you still need help with this but I'll try to give it a shot. The original "if" statement reads "if(oldButtonValue==1&&newButtonValue==0){" ; the "oldButtonValue" is defined by you, in this case it's a 1, the "newButtonValue" is defined by this command "newButtonValue=digitalRead(buttonPin);". Now, the "if" statement is not true (the arduino will not run the commands underneath the "if" statement) until both parameters (oldButtonValue and newButtonValue) are met. Since oldButtonValue is defined by you, it is true from the start, and since newButtonValue is defined by the press of the button, the "if" statement will only work when "0" is read, or when the button is pressed; at this point, everything you put in the "{ }" will run. I hope I made some sense.

  • @SarkarMotion
    @SarkarMotion 4 года назад +31

    "Stepping" up the difficulty I see! This lesson was a "stepping" stone, one might say. Oops! Sorry, looks like I "overstepped" my limits here. 😶😍

    • @VivekYadav-ds8oz
      @VivekYadav-ds8oz 4 года назад +2

      You, sir, have earned my respect.

    • @ramraja7796
      @ramraja7796 4 года назад +5

      MotiOnTech , You have taken a step in a right direction but now you must step back.

    • @minab45
      @minab45 3 года назад +4

      You should be removed from this channel, that'll servo right.

    • @jimivie
      @jimivie 3 года назад

      you need to step off with all these puns!

    • @codingvio7383
      @codingvio7383 3 года назад

      No you didn't, you are just getting started

  • @vandanasrivastava2028
    @vandanasrivastava2028 3 года назад +2

    I am from class 6 and during this outbreak I have learned how to code and use an arduino board. Thankyou sir for teaching like this.

  • @Sturb100
    @Sturb100 3 года назад

    Brilliant! I’m on day 2 of watching these. Learning so much.

  • @Ninethepoet
    @Ninethepoet 4 года назад +3

    21:52 this is everyones reaction when their first line of code works! P A S S I O N!!!

  • @geralddrake4617
    @geralddrake4617 3 года назад

    Had a little trouble with getting the stepper motor commands correct. Failed the homework assignment but gave it a good try. Steeper motors are so important for good projects. Thanks for sharing your knowledge for FREE on these videos.

  • @md.mizanurrahman5852
    @md.mizanurrahman5852 Год назад

    Dear Paul, Thank you for nice tutorial.
    I have done one on my own in harder way but after following your tutorial I made it easier.

  • @jimlabissonniere7400
    @jimlabissonniere7400 4 года назад

    Great job as usual Paul, I tried for a couple of hours, only way I could get it to work was having the button generate an interrupt. Your soulution was even easier. Thanks!

  • @damoffat
    @damoffat 2 года назад +1

    I managed it, looked back on the old button toggle code to help remember what I did back then. My only problem was leaving the number of steps at 2048, and the delay of 500ms - it almost never read the button. Then I cut it down to 10 steps and shorter delay and it worked better. My code inside the if statement was direction=-direction. Thanks for another great lesson. It's been a while, but I've been having fun with the other stuff I can do!

  • @gimmeair57
    @gimmeair57 3 года назад

    Good one coach. I was stepping back & forth while holding the button. Went back and changed it so now works as required. Happy to say I did use the -1 trick :- )

  • @madalinduna4160
    @madalinduna4160 4 года назад

    Great lesson! This time, even if I struggled few hours, I still couldn't figure how to work correctly. After viewing the video I understood my mistakes! Thank you for the opportunity :)

  • @marksholcomb
    @marksholcomb 3 года назад

    Great lesson! Thanks! You supplied all the information needed to do it on your own (with lesson 34)

  • @Mrerrol13
    @Mrerrol13 3 года назад

    I finally got it!
    I used the switch, "the old-fashioned way", with the resistor (I forgot the new system), but at the end it worked.
    I had problems with the change of direction; first because I had it at full turn and then because I discovered that printing the values on the screen slowed down the program so much that it didn't detect the press on the switch.
    It was too much work because of my clumsiness, but I finally managed to do it in a similar way as you did, Paul.
    Thanks so much!!!

  • @matthew1664
    @matthew1664 2 года назад

    I have tried so many videos to figure out this code, and it finally worked!!! Thanks so much :)

  • @menuxpressions9128
    @menuxpressions9128 3 года назад

    I wish that all RUclipsrs had your ability to understand a student’s perspective and have the ability to thoroughly teach every step in the process.

  • @gghutton
    @gghutton 4 года назад +1

    I spent 3 hours trying to figure this out on Saturday. I knew I wanted to change directions with multiplication with a '-1'. I also went back to #34 to see how the button was set up. I also added a RED and YELLOW LED lights to show which direction the motor was spinning. So I did come back here to follow step by step.

  • @eduardoantoniobarralesaisp8544

    INCREDIBLE, I was searching this like 2 hours and you finallyy made it, thank u so much

  • @anol4590
    @anol4590 3 года назад +2

    Thank you so much for this video! I hope it reaches many other people

  • @carlgrigg
    @carlgrigg 2 года назад

    I did my homework honest but the dog ate it! Enjoying making things move, thank you again sir.

  • @erikburman530
    @erikburman530 Год назад +2

    I'm so glad I stuck with this and figured it out on my own. I went through so many wrong turns but when I finally realized how to make it work the solution was so simple I had to do a facepalm! Very rewarding! And now, on to session 36.

  • @erwinvelasquez9018
    @erwinvelasquez9018 3 года назад

    Was able to complete this on my own. Thank you, Paul!

  • @chrisgosling5408
    @chrisgosling5408 Год назад

    More great Advice from Paul is to always set the serial up for debugging, this helpd me to get the case statements in the right loop.

  • @128mishka
    @128mishka 4 года назад

    Thank you very much for your amazing videos. In completely new to to world of programming and as far as electricity, I can tell difference between AC and DC.:) Your lessons are priceless.

  • @preetamsingh147
    @preetamsingh147 3 года назад

    I had attempted to do it by myself, but my solution was partly correct. And yours is perfect, so yes I did copy you, but after putting in my efforts in the solution. THANK YOU!

  • @davidbgood2801
    @davidbgood2801 5 месяцев назад

    Really enjoying these classes great teaching skills thanks so much.

  • @muhammadrafiqulislamkhan6994
    @muhammadrafiqulislamkhan6994 2 года назад

    Magic. I am learning from you. Hope I can able to do my own whithout taking any help from you but now I can not do without your support. Thank you.

  • @christopheraguilar44
    @christopheraguilar44 4 года назад

    I was soooo worried my motor didn't work BUT I followed the troubleshooting steps you showed us in all your previous videos and it turned out it I was given a dud for a battery in my shipment! Thanks for the very beneficial videos you put out ive learned so much during quarantine!

  • @nishantrishinair854
    @nishantrishinair854 2 года назад

    Hello! Thank you for the amazing videos! Before i saw these i didn't even know how to switch on an LED. I'm in the fifth grade, and already learnt so much. You are a great teacher!
    PS: I did the homework and it works!

  • @aaronmilliman7685
    @aaronmilliman7685 Год назад

    Ever have all the confidence in the world and fall flat on your face :) I didn't get the homework and am thinking about binge watching all videos from scratch to fill in any gaps I have in my brain housing group. Excellent video.

  • @PauloLopesdosSantos
    @PauloLopesdosSantos 2 года назад

    Thanks, Paul. I am doing everything by myself.

  • @allensun
    @allensun 3 года назад

    Was able to do it on my own but your use of 1 and -1 for the toggling is more clever than my solution which used a boolean variable! Thanks again.

  • @RobVollmar
    @RobVollmar Год назад

    I was able to do the "homework" on my own. This time through the series, I've been meticulous about saving old programs. Every time we have an assignment that references something we've done before (like the toggle button in this assignment), I open the older program and try and figure out how to adapt it for the new use case. Occasionally, I'll actually have to go back to the lesson where it was discussed (for example if I don't remember how to set up the circuit) but thus far, the code is usually enough to jog my memory. Several programmers I have talked to have told me that knowing how to adapt existing code is almost as valuable as writing that code the first time and I took it to heart.

  • @ujjawalgupta9221
    @ujjawalgupta9221 Год назад

    I did it myself !! All because of your lectures !!!

  • @weversonbarbieri8986
    @weversonbarbieri8986 3 года назад

    I studied at the university about arduino, but just now I am really learning.
    Thanks Paul, quite relaxed arduino lessons!!!!

  • @rachelglover4733
    @rachelglover4733 3 года назад

    For those it may help my motor was wired a little differently and after some trial and error needed IN1 to Pin 11, IN2 to Pin 8, IN3 to pin 10 and IN4 to pin 9. Thanks for the lessons Paul - learning a lot!!

  • @Gobberwart
    @Gobberwart 3 года назад +1

    As always, another great tutorial. I did the homework myself. Slightly different but mostly the same and it worked. I found that an 18650 battery works well for powering the stepper. Lasted several hours and is rechargeable. I wasn't sure it had sufficient voltage but seems fine.

  • @hanslubbe9702
    @hanslubbe9702 Год назад

    Paul McWhorter, thank you! Your tutorials simply rocks :)

  • @chris0062
    @chris0062 4 года назад

    GREAT video's, really appreciate the help, this has really made me a lot better for my mechanics
    module

  • @paulrockwell9914
    @paulrockwell9914 3 года назад

    I too found my 9V battery running out of juice while watching the video. In fact I had just noticed my motor has stopped working, checked the battery with my handy dandy multimeter and switched over to the AC adapter at almost the same time you noticed your battery was exhausted. Nice lesson - and I was able to complete it as “homework” when the video was paused.

  • @leraq
    @leraq Год назад

    I figured out how to do it on my own. Thank you very much for your wonderful lessons!

  • @marvingvx1
    @marvingvx1 3 года назад

    You accuse some of us of watching without doing the homework? The way I learn is watching through the series to absorb the concepts. After 35 video's watched and 33 to go I will watch through the second time with the hands on approach. Thank you for your contributions. :-)
    BTW My knowledge and skills with Fusion 360 have become more advanced thanks to your Fusion series

  • @DirkSimilon1
    @DirkSimilon1 3 года назад

    It's amazing for me, totally newbie in the art of electronics, that sofar I can follow and understand everything our beloved teacher says and explains, and more. He even made it possible for me to really be happy about the working of circuits. Through you Magic comes True, Paul.
    But the Stepper-lesson was a hard one. Nothing worked - I controlled all wires, buttons,....no movement of the motor, no lights on the driver. I measured a correct current on the breadboard and the controller though. I read en reread the code and made changes according to reactions of other students, I replaced the battery and even made a direct connection to the arduino-5Vpin. I even filled my cup of coffee with ice-tea. ..Nothing happened. Almost on the point of loosing all my hope, i wondered what those 2 unused pins on the motordriver did. I found out that they were meant for an on/off switch! ....and unconnected..??? so...I connected them and BOOM BOOM BOOM BOOM BOOM BOOOM boooooooM!!!!!!!!!!!!
    Never give up, you guys and girls
    ps shouldn't those pins not be covered by a little cap or something like that - or was i so unlucky to miss that in my Elegoo Super Starter Kit?

  • @lankylad4931
    @lankylad4931 3 года назад

    Thank you so much sir. This really helped me and was simple enough to understand, I myself as a thirteen year old understood it perfectly. the only part I struggled with was that the battery ran out within the first few minutes and I didn't realise- 4 hours later I finally twigged that may be the problem and it all worked.

  • @souljr.
    @souljr. 2 месяца назад

    Took me a while of troubleshooting/looking back at notes (like 30-45mins) but I finally got the program working to a fairly smooth point. I'm sure there's a much better way than what I've done, but I'm just happy to have gotten the homework done without listening ahead! Figuring out where exactly to put the delay( ) command in my program was the tricky part.
    I decided to use do...while loops to make the motor keep going until the button is pressed then change direction. Probably one of the main reasons I was having issues with the proper delay time location within the blocks.

  • @user-uz7ve3mm5c
    @user-uz7ve3mm5c 7 месяцев назад

    i did it in a diffrent way, but my method works only with a short click.
    that was a great lesson, thank you very much!

  • @mxcollin95
    @mxcollin95 4 года назад

    Great video Paul! Thanks for posting. 👍

  • @grelca
    @grelca Год назад +1

    since i am following these tutorials using micropython instead of c++, this one was kind of an adventure for me! i almost gave up and just switched to c++ for this lesson but in the end i prevailed! i ended up learning a bit about how these motors work (or at least how to control them electronically) and writing my own motor controller class after i wasn't able to find any that behaved exactly how i wanted. i think my controller class is kind of specific to the uln2003 motor driver, but that's ok
    it also took me far longer than it should have to realize that i needed to change my loop behavior from full rotations to one step at a time in order to incorporate the button press being at any time!

  • @dwightphillips2185
    @dwightphillips2185 2 года назад

    I did Tutorial 35, and did it differently than you did. I liked your coding much better. Thanks for a great series.

  • @tonytungate4540
    @tonytungate4540 3 года назад

    I did the homework, worked out quite complicated on the first attempt, but then went back and reviewed lesson 27. Much cleaner code on the 2nd go. This one made me think alot!! definatly taught me to think it through before diving in, and work out a flow diagram.

  • @ernestasvaikasas6528
    @ernestasvaikasas6528 3 года назад

    I was able to make it work without watching you, but did it in a more complicated way with more if statements. Thank you for the lesson!

  • @cjjones8414
    @cjjones8414 2 года назад

    I totally did the project and codes but on rotated one way, so had to watch you. Thank you.

  • @raviyadav-rc1br
    @raviyadav-rc1br 3 года назад

    I am doing this course twice and enjoying the same❤️