Arduino Tutorial 35: Understanding How to Use a Stepper Motor

Поділитися
Вставка
  • Опубліковано 10 лип 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
  • Наука та технологія

КОМЕНТАРІ • 1 тис.

  • @thomasmiller3398
    @thomasmiller3398 2 роки тому +59

    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 8 місяців тому +3

      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 :)

  • @JonPeroutka
    @JonPeroutka 2 роки тому +28

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

    • @mau19885
      @mau19885 24 дні тому

      so on point! stealing this since I tell so many people about him :)

  • @ericroque5813
    @ericroque5813 3 місяці тому +3

    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.

  • @Seftdelmer
    @Seftdelmer 3 роки тому +20

    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 2 роки тому +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 Рік тому +2

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

  • @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. 👍

  • @sandeepjadhav3565
    @sandeepjadhav3565 4 роки тому +11

    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.

  • @steveholt8991
    @steveholt8991 19 днів тому

    This series is still relevant today. I've learned so much going back to the basics. Thank you very much Paul.

  • @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!

  • @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.

  • @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!

  • @peterknoll8906
    @peterknoll8906 3 місяці тому +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!

  • @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.

  • @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!

  • @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.

  • @bobpattenden
    @bobpattenden 10 місяців тому

    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.

  • @gusmon83
    @gusmon83 2 роки тому +3

    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!

  • @MatlasX
    @MatlasX 4 роки тому +116

    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 роки тому +12

      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!

  • @TheSelfUnemployed
    @TheSelfUnemployed 2 роки тому +8

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

  • @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.

  • @philnewman1110
    @philnewman1110 Рік тому +1

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

  • @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.

  • @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

  • @pudgepatenaude3481
    @pudgepatenaude3481 3 роки тому +1

    So glad I read the comments. My motor would only spin one direction until I switched pins 2 and 3 on the motor controller.

  • @paulorobertoevangelista7120
    @paulorobertoevangelista7120 4 роки тому +1

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

  • @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 роки тому +4

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

  • @filipegameiro4344
    @filipegameiro4344 11 місяців тому +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.

  • @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!

  • @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 3 роки тому +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.

  • @eduardoantoniobarralesaisp8544

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

  • @ghaniyyahmbello4393
    @ghaniyyahmbello4393 10 місяців тому +2

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

  • @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 роки тому +4

    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 3 роки тому

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

  • @leokim6831
    @leokim6831 4 роки тому +1

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

  • @cbrombaugh
    @cbrombaugh 3 роки тому

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

  • @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

  • @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.

  • @marksholcomb
    @marksholcomb 3 роки тому

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

  • @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 :)

  • @dash8944
    @dash8944 4 роки тому +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)

  • @jefejc
    @jefejc 3 роки тому +3

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

  • @Sturb100
    @Sturb100 3 роки тому

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

  • @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.

  • @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 3 роки тому

      @@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

  • @lordstelanthin
    @lordstelanthin 3 роки тому +21

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

  • @mxcollin95
    @mxcollin95 4 роки тому

    Great video Paul! Thanks for posting. 👍

  • @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.

  • @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 4 роки тому +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 4 роки тому

      Well it didn't work too

    • @leonhardeuler8457
      @leonhardeuler8457 4 роки тому

      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

  • @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.)

  • @anol4590
    @anol4590 3 роки тому +2

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

  • @pranavshool
    @pranavshool 3 роки тому +3

    Yeah, I did it by using different logic!

  • @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.

  • @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!!!

  • @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 :- )

  • @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 4 роки тому +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

  • @Ninethepoet
    @Ninethepoet 4 роки тому +3

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

  • @matthew1664
    @matthew1664 3 роки тому

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

  • @karansunar4458
    @karansunar4458 3 роки тому +1

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

  • @kuravani1963
    @kuravani1963 4 роки тому

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

  • @ancienttechnologiespinball1690
    @ancienttechnologiespinball1690 5 місяців тому

    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.

  • @erwinvelasquez9018
    @erwinvelasquez9018 3 роки тому

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

  • @hanslubbe9702
    @hanslubbe9702 Рік тому

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

  • @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!

  • @chris0062
    @chris0062 4 роки тому

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

  • @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.

  • @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.

  • @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!

  • @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.

  • @danz409
    @danz409 2 роки тому

    this is EXACTLY the tutorial i needed! thanks!~

  • @davidbgood2801
    @davidbgood2801 6 місяців тому

    Really enjoying these classes great teaching skills thanks so much.

  • @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!

  • @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.

  • @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.

  • @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!

  • @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.

  • @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.

  • @parthib.1555
    @parthib.1555 Рік тому +1

    I don't have all the required components to make this project but once I have that I'll definitely make this project on my own.

  • @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.

  • @weversonbarbieri8986
    @weversonbarbieri8986 3 роки тому

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

  • @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.

  • @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.

  • @PauloLopesdosSantos
    @PauloLopesdosSantos 2 роки тому

    Thanks, Paul. I am doing everything by myself.

  • @user-yu8ic9cj1y
    @user-yu8ic9cj1y 5 місяців тому

    I was able to do it by my own! Thank you always

  • @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.

  • @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!

  • @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!!

  • @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.

  • @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.

  • @carlgrigg
    @carlgrigg 2 роки тому

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

  • @calebcruset2780
    @calebcruset2780 4 місяці тому

    GIIDYYY UPPPPP!!!!!!!!! Love it, Paul!

  • @menuxpressions9128
    @menuxpressions9128 3 роки тому

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

  • @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.

  • @souljr.
    @souljr. 3 місяці тому

    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.

  • @technomade6686
    @technomade6686 4 роки тому +1

    Thanks sir, it really helped a lot.

  • @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.

  • @bill6590
    @bill6590 3 роки тому

    More great stuff. I'm looking forward to more of them. Especially, dealing with WiFi and wireless shields.

  • @user-uz7ve3mm5c
    @user-uz7ve3mm5c 8 місяців тому

    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!

  • @leraq
    @leraq Рік тому

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