✔ Multitask Arduino with State Machines (& Switch Debouncing)

  Переглядів 67,582

Normal Universe - Chris Guichet

Normal Universe - Chris Guichet

День тому

Project and Video by Chris Guichet
www.normaluniverse.com
A State Machine is a mental tool to help you organize your code. The best part is that you can do most of the real work by drawing a diagram, so you're free to get creative and visual without worrying about syntax. Once the diagram is done, there is a straightforward "Plug and Chug" procedure to turn that picture into working code.
In this video, I show how State Machines can be used to make code with a map. The result is easy to debug, organize, modify, and communicate to others.
Table of Contents:
0:00 - Intro
2:40 - Switch Bouncing
5:45 - Draw a State Machine
14:30 - Code a State Machine
28:00 - Use your Power for Good
"Primer" for Arduino beginners:
• How to Get Started wit...
Simple Button State Machine:
gist.github.com/NormalUnivers...
Button, Buzzer, LED Multitasking State Machines:
gist.github.com/NormalUnivers...
Music:
"Rewind" - On Ice
"Brave" - Memba

КОМЕНТАРІ: 313
@DanPeters55873
@DanPeters55873 5 років тому
I never comment on videos, I feel as though it just becomes noise in the midst of the rest of the comments. I truly hope you see this because I want you to know that this is truly one of the best maker videos on UKposts, and I do not say that lightly. I consume a mass amount of various maker videos to learn, make my projects better, and to come up with great new ideas. Your video was excellent for several reasons; first, you were extremely informative and detailed in your code and explanation of the code. So many just throw out what they have copied and pasted from some other source online. Without a doubt, I'm certain that you are experienced and advanced enough that you can write all of this from scratch. Secondly, you showed what can go wrong and how to debug and find solutions to solve the problem. This is the essence of all programming is debugging and solving problems. It is so refreshing to know that I am not alone in banging my head on the keyboard when my sketches won't compile or run in the manner they were intended or expected. It reminds me that to succeed, you must press through and persevere. Thirdly, your videography was the best of any maker video I have seen yet, bar none! And as I have said, I have sometimes wondered if I have reached the end of UKposts. I know how much time, effort and painstaking editing that it took to create content of this caliber. It has a greater purpose that I initially didn't realize other than just making impressive shot sequences and Premier tricks such as your coding text being typed out on the screen. Let's face it, even for the enthusiast, the nuts and bolts of coding can bring on the glazing over of the eyes and the absent wandering of the mind, even when we want to pay attention. The creativity of your video kept me engaged and hyper-interested and held off the monotony of codeing. Your lighting was excellent, your audio was excellent, and your editing was superb. I haven't even watched any of your other videos before I wanted to comment and encourage you that your hard work and effort is greatly appreciated, at least by me. I know that UKposts creaters are swimming in a see that is so crowded, the sharks have given up. Keep swimming, you my friend, will stand out when the rest have sunk to the bottom!
@TheNormalUniverse
@TheNormalUniverse 5 років тому
Dan Peters thank you for typing this! Definitely not lost in the sea of comments. This comment helped me get out of bed the other day. I’m glad you picked up on my emphasis on debugging. One of the best parts of this coding method is how it helps with debugging, so I wanted to “show” it instead of say it. I also like that you noticed my audio. I think audio is more important than video so I definitely put some effort into it. Haha ya, this video took me almost a year to make. LUCKILY people search for it. It’s not as popular as my video on mechanical drawing, but I’m glad there is a small audience that really like it some people let me know. It’s definitely my baby and the peak of my video making. In the future I’m going to dial it way back and make simpler videos. This video took me about a year to make in between my day job. I definitely bit off more than I could chew :). Thanks again. Happy hacking!
@johanarcosmendez4680
@johanarcosmendez4680 Рік тому
Agreed. You killed me with the Nerf gun alarm clock! We are proud nerds 💯
@wallacefreedom76
@wallacefreedom76 2 місяці тому
Seriously! Your meticulous attention to detail - even using stop motion animation! - to relay your thought and add visuals while you speak helps the audience fully understand what you're saying.
@pboston6RR
@pboston6RR Місяць тому
Well done. The information was presented on a logarithmic fashion with a slow start and a steeply rising level of complexity. The last part with the most information happened really quick. Fortunately, there is a rewind available on UKposts. I used it a LOT! Thanks for all your efforts.😊
@naboulsikhalid7763
@naboulsikhalid7763 4 роки тому
I don't like complicated codes, but the way how you put this complicated code together makes it easy to grasp. thank you for sharing knowledge, I liked and subscribed
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
Naboulsi Khalid thanks Naboulsi! I’m always quite jazzed that people are enjoying this video ^_^
@Zhixalom
@Zhixalom 4 роки тому
The 115200 is a remanence from the pre-USB era, where our computers had serial ports with DB9 and DB25 plugs. The max speed for a standard RS-232 serial connection back then was 115200 Bps. When initializing a connection to an attached serial device, say like a telephone modem, the device would usually expect a speed of 9600 Bps until it would receive commands to change the speed. Older devices would expect lower speeds and some, like what we called “dim console terminals” often expected 38400 Bps. But for the longest period, the default initialization speed was 9600 Bps. I’m going to spare you for the whole Baud vs. Bps explanation since it is not really that important anymore and one of those things, I would hope to forget one day. Most Arduinos have a small secondary microcontroller on board for controlling communications through the USB port. This UART controller simulates one of these “good” old-fashioned RS-232 com-ports by default. This is why your Arduino shows up as a COM device when you hook it up to your computer. But this small controller can be reprogrammed to simulate RS-422 or RS-485 as well or even pretend to be a keyboard, a mouse or various other devices like joysticks, gamepads, PlayStation or Xbox controllers, etc. etc... basically any kind of device you can imagine to hook up via USB. So, with the “Serial.Begin(115200)” instruction you are pretty much just telling the Arduino to establish a serial connection to your computer through the simulated COM port at the speed of 115200 Bps. The Serial.print(“Some Text”) could be interpreted as SendString instead and Serial.println as SendString(“Some Text”) followed by a CR and a LF (next line). CR = Carriage Return = ASCII value 13 / 0x0D LF = Line Feed = ASCII value 10 / 0x0A I really enjoyed your video by the way 🙂
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
Awesome, Thanks for all the background info! I pinned this comment to the top. Im honored that someone as knowledgeable as you would enjoy my vid!!
@Zhixalom
@Zhixalom 4 роки тому
@@TheNormalUniverse I am still in the learning phase when it comes to Arduinos and micro-controllers. But with 35-36 years of computer-baggage, it is quite easy for me to connect the dots. It almost happens automatically without me actually noticing that I am doing it. Maybe you will find this interesting (it is not something I have made): github.com/AlanChatham/UnoJoy
@vardfriki7274
@vardfriki7274 2 роки тому
Thank you! Don't change anything about how you do your videos. They're great. Congratulations on your approach.
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
Thank you for the nice note Vard! I can't believe it's been 11 months since my last vid. I need to get back on the saddle.
@vardfriki7274
@vardfriki7274 2 роки тому
Honestly, you've helped me so much. I've adopted your approach and have been able to untangle my code, and also do far more complicated tasks simultaneously without the dreaded delay! Makes coding far more enjoyable. Thanks heaps.
@stever3886
@stever3886 3 роки тому
Just learning state machines and this is a very simple and understandable code. Like how you walked through Code evaluation and changes.
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks for letting me know Steve! Glad you liked it
@TomTalley
@TomTalley Рік тому
Nicely done...I used to build interrupt driven state machines with error handling in LabVIEW. That was many years ago. Now, I have found microcontrollers again and really enjoyed your very good description of how to build state machines...my new model...thanks very much...!
@TheNormalUniverse
@TheNormalUniverse Рік тому
Thanks for letting me know!
@yiqiaowang9874
@yiqiaowang9874 Рік тому
Man every arduino learner should watch this video. Not just because State machine is the jump from beginner to advance level, but the video itself is clear, thorough, and fun to watch. Hope to see more of your works!
@TheNormalUniverse
@TheNormalUniverse Рік тому
Thanks for the nice comment! This video really is my best work haha, but it took a year in between work and life.
@johneagle4384
@johneagle4384 2 роки тому
Beautifully done (Yes, I find beauty in coding, state machines and Arduino boards) Very, very useful tutorial. I'll recommend to everyone I know.
@Boffin2002
@Boffin2002 4 роки тому
Well done! My first attempt at employing a state machine was 40years ago and was for a multiple-input/output alarm card to be used in telephone exchange equipment - well before Arduino. The State Machine concept greatly simplifies the hardware pre-MCU days and your examples show how well it can be employed in software. I particularly liked how you overlayed the code. That alone is something that could be made great use of by other channels.
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
Glad you liked it! Ya I was really proud of how I did that code segment. New video coming out in two weeks or so!
@justingoldstein1577
@justingoldstein1577 Рік тому
Good stuff this video has aged so well it's still incredibly relevant even though Tech and coding environments keep changing You speak great truth and do it very well thank you
@TheNormalUniverse
@TheNormalUniverse Рік тому
Glad you enjoyed it! Thanks for letting me know
@leec2106
@leec2106 6 місяців тому
Well it is now 5 years later and the start of winter, it snowed 3 days ago. I like what you did, I have 5 contacts, one is a push button. The 2nd and 3rd are a rocker switch, if switch left move stepper left, if right move stepper right. Left or right will go until it sees a stop switch the last 2 of the 5 will put it into standby mode, wait for left or right, the push button will bypass a pot that sets the speed, to full speed to the end stop. I plan on using a modified version of what you wrote here! FYI, I did not know a comment helps in your content until today! Lee
@TheNormalUniverse
@TheNormalUniverse 6 місяців тому
I’m glad the video helped you! Thanks for letting me know
@CheffreyGriffin
@CheffreyGriffin 6 років тому
Wow, as a self taught hobbyist, this has been the best and coolest thing that I've come across for organizing and building code. I love it. Subbed.
@TheNormalUniverse
@TheNormalUniverse 6 років тому
Jeff hell yeah! I’m also self taught, so maybe that’s why we jive.
@Younes838
@Younes838 6 років тому
Dude! Excellent video! Easy to follow with top tier production value. Keep em coming! Subscribed and liked!
@TheNormalUniverse
@TheNormalUniverse 6 років тому
Benjamin Younes haha thanks. You can kind of see how I got better at making video as this video goes on. Will do! For a while the vids will be much simpler. This one consumed all my free time for 4 months.
@chrisbenner2463
@chrisbenner2463 3 роки тому
I also have never really comment on videos and I just want to say that I've been studying C and C++ for the last month and your video actually finally allowed me to feel confident on how to organize my code. Please keep making more awesome videos!
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Awesome! Thanks for letting me know. I should say that I'm somewhat self taught on coding, so I don't know if these ideas are considered "correct" by the experts. But I asked a few friends who are real programmers and they said "ya this looks fine." I think there are a lot of different ways to set up a state machine and everyone does something different.
@nen848
@nen848 3 роки тому
Yo dude you just simplified months of thinking into a 30 minute video. PLEASE MAKE MORE TUTORIALS ON THIS and working with more complext Arduino code, especially using other languages on arduino PLEASE PLEASE PLEASE. Thank you so much This is the definitive best maker video on this channel. It's simple, fun, not cringey, well recorded and gets to it's point plus it uses timestamps for easy reviewing. BEST MAKER VIDEO EVER
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks for the super nice comment Nen! This video was definitely my peak and I'm glad people are getting use out of it because it took a long time to make. That was kind of the apex of my coding knowledge (self taught) so I won't be able to make another video soon because I have more learning to do. One topic I want to cover is how to use object oriented programming on Arduino. It's a good way to make your code and portable as the projects start to get more and more complex. Synergizes well with the state machine stuff covered in this video.
@nen848
@nen848 3 роки тому
@@TheNormalUniverse I would love to see that video so much. This is legitimately amazing and I'm here for more of your stuff. I love seeing approaches to learning from people who are still learning and can admit that. Continue to make content man, I'd love to see you being a huge maker content creator like the VoidStarLabs guy but in your style
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
@@nen848 voidstarlabs is amazing! thanks again
@juicyblunts
@juicyblunts 5 років тому
Hands down one of the best, or at least most engaging videos on programming that I've ever seen. Well done and hats off to you for making such a dull subject an entertaining treat. Great content, will be sure to check out more of it!
@TheNormalUniverse
@TheNormalUniverse 5 років тому
Juicyblunts thanks! I probably wont make something this involved for a long time haha. Too much work. Expect more sewing and simpler projects in the near future
@TheCalvinSkinner
@TheCalvinSkinner 2 роки тому
Let go man just be yourself, you're giving off nervous energy. Fantastic video and very well explained.
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
Thanks for the nice comment! Yup I know I have nothing to be nervous about, and I enjoy teaching a lot. Always working on improving my delivery. It's just much harder to teach when you're talking to camera instead of, say, helping your friend with homework. The camera doesn't give you the feedback loop that you get when your friend asks questions and keeps the flow going.
@diegor1115
@diegor1115 3 роки тому
the view of you writing code while also showing your face is really good.
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks! I was really proud of that effect to make the code section less bland
@ArsenioDev
@ArsenioDev 6 років тому
This is a fantastic video, especially liked the code overlay on the video while you explained it. Subbed for more
@TheNormalUniverse
@TheNormalUniverse 6 років тому
Arsenio Dev thanks! I was really excited when I got that code overlay effect working. I had to block all my windows to make the background in my garage dark.
@ArsenioDev
@ArsenioDev 6 років тому
the best effects usually take a lot of time but pay off in spades
@muthukumarankothandaraman5481
@muthukumarankothandaraman5481 4 роки тому
I wonder why such a crystal-clear video is having such a low count of views.One of the best Arduino FSM videos I watched. Right now, I am working on an Arduino Kinetic art project and was framing my FSM with stepper motor + led-fading + tilt-switch sensing (of course with debouncing) states and found this tutorial to be extremely useful as a quick-recapitulation (perhaps video is so clear that nobody revisits :-)). Thanks a tonne !!
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
Awesome! Thanks for letting me know you like it. This video definitely appeals to a very niche set of nerds. But I'm happy that the people who do watch it tend to like it a lot!
@rawleystanhope3251
@rawleystanhope3251 Рік тому
Most helpful (and entertaining) Arduino tutorial EVER!!!
@TheNormalUniverse
@TheNormalUniverse Рік тому
Thanks for letting me know! This video is my magnum opus
@jimmytumbles9640
@jimmytumbles9640 2 роки тому
14:38, I've never seen anyone put a composite of two video feeds like this... dude... thank you for this. This sparks inspiration beyond the source material just in the effort and the ideas in the video itself. Thanks again. Super cool way to show code.
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
Thanks Jimmy! I was really proud of that. I knew I would have lots of coding in this video so I wanted to find a way to make it less boring. What I did was filmed my face and recorded my screen at the same time. In final cut I put the screen recording footage on top of my camera footage and used a chroma key to make the background of my text editor transparent so only the text shows up. Also I used a dark theme on the computer and set up the lighting in my garage to provide a dark background for the text.
@aBabyWarcow
@aBabyWarcow 6 років тому
This is a very well put together video! Keep them coming!
@TheNormalUniverse
@TheNormalUniverse 6 років тому
A Baby Eskimo thanks for the motivation!
@germanshorthairdude
@germanshorthairdude 4 роки тому
Fantastic video!!! I’ve watched it several times, and find it is jam packed with information. You made State Machine seem achievable for mere mortals. You obviously put a ton of work into making this video. I really hope you enjoyed making the video, because it is really good. Subscribed and looking forward to your next installment. If you decide do a Patreon and more Arduino content, I’m in!
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
D Mc awesome! Thanks for letting me know you like it! I think this video took over 100 hours so I’m happy that people are finding it and watching it. This is definitely the peak of my arduino knowledge so if I make another arduino video in the future it will be dialed back haha
@PoorRoleModel
@PoorRoleModel 4 роки тому
This video was an excellent resource getting back into the mentality of state machine coding, and got me back on my feet from years and years of just not needing it. I also love the charm in the way it was all presented, and the ease of explanation made it all a breeze. I was able to create a complex state machine, while simply taking the concept from the video, allowing the code to grow to use organically. Well done, my dude. Well done. Hopefully you intend to do much more content like this! I will definitely be linking this video in one of my own on the way, with an automated climate control system vivarium build! I hope you don't mind!
@PerchEagle
@PerchEagle 3 роки тому
I'm going through the beginning of the video, really interesting, enjoyable and one important thing is the passion of a programming hobby mixed with another hobby ! Also the video editing and the natural location effects are remarkable.
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks! I'm glad you enjoyed it. I knew I wanted an example activity to describe how a complex behavior can be broken down into states, and archery came to mind.
@evanlane1690
@evanlane1690 2 роки тому
This was an excellent breakdown of the workflow and specifics required to get a state machine working. I've watched a lot of tutorials on this in the past but they always miss something in describing how to think about problems and turn them into FSMs. It finally clicked for me with this video. Thanks man. Liked and sub'd.
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
Thanks for sticking through such a long video and letting me know Evan! Glad it was helpful for you.
@usmanriaz8396
@usmanriaz8396 2 роки тому
i always used to write delay() but after watching this video i can already see possibilities of multitasking
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
awesome! you're on the right track
@wallacefreedom76
@wallacefreedom76 2 місяці тому
Dude! Seriously your REALLY GOOD at making videos! I've been watching A LOT of UKposts videos regarding arduino and electronics and programming. You are definitely very good at making me engaged in what you're trying to explain and making it funny - which is always good to help keep it light, and still have my attention. Looking forward to finding more videos from you!
@TheNormalUniverse
@TheNormalUniverse 2 місяці тому
Thanks for letting me know! Glad the video was helpful for you
@gamerfam8206
@gamerfam8206 4 роки тому
I took two pages of notes, thank you soooo much for your exceptional video!!!
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
Awesome! Thanks for sticking through such a long vid!
@void6378
@void6378 5 років тому
Thanks A LOT. Awesome video once again and I can't believe I just saw the whole video without a skip and woah. I didn't realize it's 30 mins already until you said it. Thumbs up once again.
@TheNormalUniverse
@TheNormalUniverse 5 років тому
Hell yeah! Thanks for letting me know. Feel free to tag me on Instagram or something if you make a project with a state machine, I’d love to see (I’m @lesguichets)
@OstrichLongneck
@OstrichLongneck 5 років тому
This is an excellent tutorial. I started out totally clueless, but after watching this 30 minute video, I coded my very first state machine! I wish there was a lot more content on this channel, as it's presented so wonderfully that even a lunkhead like me can learn easily. - Trevor
@TheNormalUniverse
@TheNormalUniverse 5 років тому
Ostrich Longneck hells to the yes! This makes me a happy panda. I’m almost ready with my first sewing video, just took half a year o_o
@itisonlyadream
@itisonlyadream 5 років тому
I learned so much from this, I never understood how to use CASE until I watched this video. Thanks!
@TheNormalUniverse
@TheNormalUniverse 5 років тому
yeah boye that's like 20 minutes into the video. Thanks for watching!
@itisonlyadream
@itisonlyadream 5 років тому
​@@TheNormalUniverseI want to acknowledge that there is much more to your video than an explanation of the CASE statement. You begin by explaining the State Machine concept, then you show how to use Top Down design to create a State Machine diagram and implement it in code with the CASE statement. You made a complete and well organized presentation, which covers much more than the CASE statement. I only focused on your explanation of CASE in my first comment, because I didn't understand the CASE statement until I watched your video. The first time I read about CASE was on the Arduino website. That was many years ago, when the Arduino first went on sale. The only information they had on the Arduino website at that time about the CASE statement was a condensed one-line explanation. I didn't have a programming background and I never took a programming course. I didn't even know anyone who wrote code, so with nothing to go on but that little one-line explanation on the website, I was not able to get the CASE statement to work in my programs. As a result, I gave up on CASE and I've been trying to write Arduino code all these years with IF / ELSE and WHILE statements, without realizing that it would have been much easier to implement some of my code with the CASE statement. While watching the explanation of CASE in your video, I realized for the first time, that I failed to noticed the importance of BREAK in that original one sentence explanation of CASE on the old Arduino web site. It seems to me, that CASE is almost useless without understanding how to use BREAK. There was no intention on my part to minimize the first twenty minutes of your video, it was just that your explanation of CASE, which explained the use of BREAK, was a revelation to me that will change the way I write Arduino code going forward. At times, when writing code, it's the simplest little details that can stump us. For those people who already understood the CASE statement, the important part of your video was learning how to write a program by first organizing one's thoughts, then applying Top Down design philosophy to create a state machine, with the last step being to write the actual code. Your lesson is an important one, because many of us just start coding and try to build a program from the bottom up. That method works for small programs, but it fails miserably when the program begins to get complicated. I know I speak for many people when I say THANK YOU for all the time, thought, and effort you put into making this excellent video.
@joyalgeorge5651
@joyalgeorge5651 3 роки тому
Great vedio bro. I'm surprised watching how much effort you put in to make this one of a kind vedio in UKposts. Even after 3 year this stands relevent entertaining and very informative.
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks Joyal! I'm working on making my own synthesizer now and I'm actually feeling pretty strong at coding despite being self taught, thanks to the things I learned in this vid. I thought I wouldn't have any more coding videos to do after this one but now I'm getting some ideas. Happy hacking!
@joyalgeorge5651
@joyalgeorge5651 3 роки тому
@@TheNormalUniverse pretty excited to see that.. all the best
@Dyrgrip
@Dyrgrip 4 роки тому
How could I miss this one? Awesome work! Great subject and all the other things the other guys down here already told you :) I'm impressed! Keep it up!
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
yay I'm glad you liked it! This vid is definitely my mastahpiece so far. Sorry it was so long. I should have found a way to handle state machines and switch bouncing in separate videos.
@charltonmutugi7129
@charltonmutugi7129 3 роки тому
This is probably the 2nd video I hav commented on. Thanks for the great tutorial
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks Charlton! I'm still amazed that people found my 30 minutes of rambling useful. Thanks for letting me know! I'm learning how to code synthesizers now I'll probably make videos on that in the future
@Jptoutant
@Jptoutant 2 роки тому
thats a well done piece of work there, amazing
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
thanks JP!
@justinfoto
@justinfoto 5 років тому
Super helpful! Please make more of these Arduino tutorials!
@TheNormalUniverse
@TheNormalUniverse 5 років тому
Thanks for letting me know! Haha sorry I might not make an arduino vid for a bit. This is totally the peak of my arduino knowledge. Maybe if I do an arduino project I’ll show you my state machine and point back to this video.
@jpconstantineau
@jpconstantineau 5 років тому
Great video! It describes very well how state machines can be designed and implemented on Arduino with 2 practical examples. I will refer back everytime I need a refresher...
@TheNormalUniverse
@TheNormalUniverse 5 років тому
Thanks! I'm always glad to know this helps people. This video is like my baby. It doesn't appeal to a very large audience but I'm super proud of it.
@sarthak761
@sarthak761 3 роки тому
This video is a gem!!! I am keeping it saved and downloading it for future revisions. I don't know how did I end up here, I work on 32-bit ARM cortex-m microcontrollers; for the very first time I am happy with youtube's recommendation. uint8_t Make_more_of_these_videos=1; char * state; If ( Normal Universe && Make_more_of_these_videos ) printf("%s", state = "Happy"); else printf("Do make me Happy!! "); //either way please continue your videos coding like this
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Hey thanks for the super nice comment! I was burned out on programming for a while after making this vid but back into it now. I'm trying to program an embedded synthesizer. I'll probably run it on Raspberry Pi. Stay tuned for more!
@TeotoniodeCarvalho
@TeotoniodeCarvalho 3 роки тому
Very good! Never heard of that before and after this video I spent 2 days studying the concept. It makes things a whole lot easier. Thank you very much! Greetings from Brazil!
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Awesome! I have a big smile on my face. May your arduino projects be successful. Tchau!
@fabriziodutto7508
@fabriziodutto7508 3 роки тому
Very interesting video, telling the viewer you are a very kind person, willing to share what you've learned by doing! Thank you for sharing.
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks Fabrizio! Glad you liked it.
@a3gzuy
@a3gzuy 3 роки тому
I loved the video's style and content. Thank you very much!
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks for letting me know! I'm most proud of this vid and my vid on mechanical drawing
@davidbernfeld2609
@davidbernfeld2609 5 років тому
Great video! Great editing! Great subject! Great teaching! My two cents: when I debounce a switch, I enter the trigger state AS SOON as I detect a change. My way of debouncing is just by ignoring the switch for the remaining set debounce time after the trigger. Also, I check for the switch to be released to go back to reset. Your method waits for the electromechanical noise to end, then the set debounce time to elapse, then for the switch to be released. Mine is is as fast as can be and then waits for debounce time and button to be released before reseting and searching for a falling edge again.
@KidCe.
@KidCe. 4 роки тому
Just subscribed to you in hope that there will be new videos soon ^^ Your Video Style is really awesome!! Super clean explanation of how it works and nice editing. I really liked the ways you overlayed to code to the facecam, never seen someone doing coding tutorials in such a clean way !
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
My friend! Thank you for the nice comment and appreciating the details of my hard work. More videos to come, just trying to find something interesting to make videos on. I'll probably do something on camping for the summer.
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
Thanks! I was super proud of that. I knew there would be a lot of coding in the video so I wanted a way to make it less dry.
@maxholland8587
@maxholland8587 6 років тому
Awesome! I'm working with some friends to create a system that turns on a LED strip based on an IR proximity sensor input. We are having issues with denounce and I was suggesting we look into state machines based on some research but didn't have enough knowledge to explain. Couldn't have found a more helpful video.
@TheNormalUniverse
@TheNormalUniverse 6 років тому
Max Holland yaas. It was tricky to find an example problem that hit the topics I wanted to hit in the correct order. Glad you liked the video.
@codyporter4680
@codyporter4680 3 роки тому
I just want to say this video was tremendously helpful! I look forward to using it in an upcoming project. Keep up the great work>
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
thanks for letting me know Cody! editing a teardown video right now
@pedde27
@pedde27 5 років тому
Thanks, never saw a better Arduino tutorial :)
@TheNormalUniverse
@TheNormalUniverse 5 років тому
Pat Rick thanks Mr. Rick!
@zhihaozhang1963
@zhihaozhang1963 5 років тому
This video is so amazing! I am doing Arduino Project now and it helps me a lot! Please, please update more videos!
@TheNormalUniverse
@TheNormalUniverse 5 років тому
Zhihao Zhang thanks a lot! I’m glad it helped. I probably won’t make an Arduino video for a while, sorry. This one took almost a year to do in between my real job. It’s definitely the video I’m most proud of though.
@Twdiap
@Twdiap 5 років тому
Man you saved my project. Love ur videos
@TheNormalUniverse
@TheNormalUniverse 5 років тому
haha thanks! I'm happy that someone used my tips! how did you find the video?
@adabill295
@adabill295 6 років тому
great video, very understandable. I've see state machines examples in the past but never completely understood them. This explanation is very clear and now i know how and why to use them. have a grandson that I'm trying to get involved with Arduinos (Programming) and this will be a very good place for him to start understanding State Machines. Pleas, keep up the good videos.
@TheNormalUniverse
@TheNormalUniverse 6 років тому
+AdaBill thanks for the nice comment! We need to get the young ones hooked ASAP!
@Grzzs
@Grzzs 3 роки тому
I agree with everyone here! This video was really well thought out. The dialog was concise and spot on. I really hope you keep up with the arduino coding projects and teach us about them. I have worked with case switches but never have thought about it in this way. I learned more than just the state machine stuff. Keep it up! I have sub'ed now!
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks for letting me know John! I thought I wasn't going to make a coding video again after this but recently I'm getting really jazzed about making a Synth on Teensy. Just getting started but I'm sure I'll have lots of topics to make videos about in the future. If you haven't heard of Teensy look for Voistar Labs' video on it.
@johncortex7582
@johncortex7582 3 роки тому
with great power comes great responsibility
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
I'm a little embarassed I called my blinking lights "great power" *facepalm emoji*
@milltron76
@milltron76 6 років тому
Great video. I use state machines in my projects at work. The next step is state machines using function pointers.
@TheNormalUniverse
@TheNormalUniverse 5 років тому
haha this video is totally the peak of my understanding of coding. Will need to learn pointers some day
@sonusagarkoo7123
@sonusagarkoo7123 3 роки тому
Underrated video, thanks man this helped me alot.
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks sonu! Glad it helped
@VasilisKarastergios
@VasilisKarastergios 6 років тому
Subbed and liked, i really like the way you explain things! I hope you do continue making arduino tutorials! Thank you.
@TheNormalUniverse
@TheNormalUniverse 6 років тому
Vasilis Karastergios good to hear! I hope my perspective is unique/useful. It’s quite tricky to teach without someone asking you questions in real time.
@VasilisKarastergios
@VasilisKarastergios 6 років тому
Hi there && thanks for replying, I will give you a topic for a future video! How to use an external or the internal eeprom to store values. Greetings from Greece.
@RomanKuechler
@RomanKuechler 5 років тому
Great explanation! Many thanks!
@nybeath
@nybeath 6 років тому
You’re back!
@nickp6857
@nickp6857 4 роки тому
Fantastic video! Very well made and very well explained, really helped me a lot with my project :)
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
awesome! thanks for letting me know. This video is my baby
@Ninjamstrboy
@Ninjamstrboy 2 роки тому
bowhunters unlimited!!!! this is awesome! love the archery range.
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
Thanks! I just got into archery at the time and needed some random topic to talk about to use as an example
@Ninjamstrboy
@Ninjamstrboy 2 роки тому
My lab mates and I had a good laugh about the coincidence of these two areas. Cheers!
@atlaskaiser9951
@atlaskaiser9951 2 роки тому
This is Absolutely Beautiful!
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
Thanks Atlas! It was definitely my peak. Most proud of the way I showed the code
@Karim3ds
@Karim3ds 3 роки тому
Thank you for your time and work, appreciated
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks for letting me know friend!
@pratahsinnetamby
@pratahsinnetamby 3 роки тому
Brilliant video - many thanks!
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks for letting me know Mr. Observer!
@ansolisju
@ansolisju 3 роки тому
This is a greatly built video and really useful!!!! Thanks a lot!!! It can show that you have spent time doing this video!!!
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
My pleasure Nicolas! I’m glad this video is still getting views and a select group of nerds is enjoying it. How did you find the video?
@ansolisju
@ansolisju 3 роки тому
@@TheNormalUniverse really useful!!, I'm just getting started with arduino and the state machine concept!
@ravinpijitham5555
@ravinpijitham5555 5 років тому
I had problem to understand state machine in long time, how to do. But very clear now after see your clip.Thank you very much
@TheNormalUniverse
@TheNormalUniverse 5 років тому
ravin pijitham great! I’m glad it helped
@thecoolaravind
@thecoolaravind 4 роки тому
Kudos to your passion in teaching .... liked the way you taught than what you taught. [ I would prefer to fix that bouncing issue rather in hardware using debounce circuit (schmitt trigger and RC filters)]
@GuillaumeJACQUIN
@GuillaumeJACQUIN Рік тому
Hello Chris, Just few words to say you made my day (French's way to speak) ! Thanks for sharing great content ! you win my subscride ans consideration...
@TheNormalUniverse
@TheNormalUniverse Рік тому
Merci beaucoup Guillaume! J'ai etudie le francais pour 5 ans, mais j'en ai oublie un peu. Je pense que cette video est mon meilleur. J'aime savoir quand mon video est utilize.
@GuillaumeJACQUIN
@GuillaumeJACQUIN Рік тому
@@TheNormalUniverse 🙂 Crhis, your french is better than my frenglish don't worry ! You make me see an other way to code with yours videos and I'm thankful, you've really open my mind 😃 Have you some project arduino and video to come ? Amitiés.
@gabriel_gelli
@gabriel_gelli 3 роки тому
Great video! You made sure that programmers at any level would be able to understand the topics discussed. Two tips for others interested in creating State Machines: - Use Enum instead of numbers to define the states. (This is the most usual method, though it made sense to use numbers in the video to make it clearer) - LucidChart is a marvelous software for creating flowcharts and diagrams!
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thanks Gabriel! I agree about the Enum thing. I'm self taught so I goofed on that. I'll have to check out lucid chart.
@instituteoforthopaedicssur3410
@instituteoforthopaedicssur3410 3 роки тому
Nice video its best video for ardiuno learner's
@toshanluktuke7610
@toshanluktuke7610 2 роки тому
Fantastic and entertaining video!
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
thanks Toshan!
@rpsingh5783
@rpsingh5783 Рік тому
very impressive presentation
@TheNormalUniverse
@TheNormalUniverse Рік тому
thank you!
@billallen275
@billallen275 4 роки тому
Wow - that is really neat. Thinking back in it, MS_Basic comes to mind, with the evil GOTO statement. While that could (and often would) degenerate to a pile of spaghetti, it did provide a way to implement a state machine. Seeing this, I think that is what some programs I recall seeing and wondering about at the time were doing, in a loose way. Thanks!
@allanpatterson498
@allanpatterson498 3 роки тому
The State machine to me a Novice hobbyist resembles elements of XOD. A very interesting concept I shall study.
@Farming-Technology
@Farming-Technology Рік тому
9:06 when a coder edits a video. 🤠 I should add that this is excellent content. There is a lot of good stuff on UKposts for learning the how, but once you have the syntax down learning the why seems hard to find. This really hits the spot. I see you've not posted for a while, I hope you are well and wish you the best.
@TheNormalUniverse
@TheNormalUniverse Рік тому
thanks for the nice comment! This vid is my magnum opus. I've been focusing more on work lately, I might start making videos again in the future
@anwaralfawdaei3381
@anwaralfawdaei3381 3 роки тому
great tutorial. all the best for you .
@TheNormalUniverse
@TheNormalUniverse 3 роки тому
Thank you for letting me know Anwar! I'm going to start making coding videos again soon about synthesizers
@Ahmadnaweed786
@Ahmadnaweed786 5 років тому
great! keep it up!
@davidkellermann9536
@davidkellermann9536 2 роки тому
great video, Very helpful!
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
thanks for letting me know!
@charltonmutugi7129
@charltonmutugi7129 3 роки тому
Brilliant,!!
@Olavotemrazaodenovo
@Olavotemrazaodenovo 4 роки тому
Congratulations from Brazil
@volodimirkun
@volodimirkun Рік тому
Awesome video! Enjoyed !
@TheNormalUniverse
@TheNormalUniverse Рік тому
great! thanks for letting me know
@volodimirkun
@volodimirkun Рік тому
@@TheNormalUniverse I love the approach and contents itself is wholesome. My greetings from far Ukraine!
@LuisDanilo95
@LuisDanilo95 4 роки тому
God damn it! What a excellent video!
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
awesome! thanks for letting me know ^^!
@yashaswikulshreshtha1588
@yashaswikulshreshtha1588 2 роки тому
I think normally intermediate programmers can't do programming in organized manner as it is supposed be cuz they can't figure out how to make a state machine and what parts of problems corresponds to what states. I think once their vision is clear towards problem they can make this machine and it will be a lot helpful in programming
@naveengupta5588
@naveengupta5588 2 роки тому
i learned something new and i loved it
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
Thanks for letting me know Naveen!
@naveengupta5588
@naveengupta5588 2 роки тому
@@TheNormalUniverse The explanation was so subtle and detailed i loved it. Even for 1 sec i didn't required to rewind to understand the concept. Thanks alot for this amazing video.
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
Good to hear. My main concern was people getting lost in such a long vid. Luckily this video has sustained life! I'm glad because it took a lot of effort. Most videos only get views for the first week or so. A select club of nerds continue to find this video from youtube search :)
@naveengupta5588
@naveengupta5588 2 роки тому
@@TheNormalUniverse 😇😇😇please continue making these amazing videos.
@zacsonskaria
@zacsonskaria 4 роки тому
Excellent video.
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
Zacson Skaria thanks Zacson! It’s definitely my MAHSTAPIECE!
@rd-tk6js
@rd-tk6js 5 років тому
Well explained Thanks !
@AlvaroMenezes
@AlvaroMenezes 4 роки тому
Dude, thanks for te content. It helped me a lot!!!!
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
nice! thanks for sticking around for such a long vid
@maokai8310
@maokai8310 4 місяці тому
that was great, thank you
@TheNormalUniverse
@TheNormalUniverse 4 місяці тому
thanks for letting me know!
@KK-fh1ds
@KK-fh1ds 4 роки тому
Subbed real fast. Please keep making videos
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
K K haha thanks! Unfortunately I won’t be making a video this complex for a long while, it took me almost a year. BUT I will keep making videos!
@KK-fh1ds
@KK-fh1ds 4 роки тому
@@TheNormalUniverse glad to see you're active in the comments too. Honestly one of the better parts of the videos is how your nice guy personality shines through. Also the explanations are very good. Keep active and don't let the celebrity go to your head. Thanks alot my guy💪
@TheRemo176
@TheRemo176 4 роки тому
This is soooooooooo high quality, I can't believe I found this amongst very unwatchable videos
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
great! now I just need to pick up the pacing haha. I have trouble getting the words out
@MickeyMouse-lf4gr
@MickeyMouse-lf4gr 5 років тому
awesome video - great examples :)
@TheNormalUniverse
@TheNormalUniverse 5 років тому
Mickey Mouse great to hear! I’m really glad people still watch this vid even though it’s 30 minutes. It’s my baby.
@TheCalvinSkinner
@TheCalvinSkinner 2 роки тому
Laser teacher is cool
@race2winss
@race2winss 4 роки тому
subbed great video! keep up the good work! Thanks!
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
race2winss thanks for letting my know you liked it! I just did a big move so I’m out of the video habit but want to get back into it soon’
@louiscelenza8017
@louiscelenza8017 5 років тому
Excellent job! This is exactly what I have been looking for. I have 17 multitasking Arduino game ideas (written descriptions in a notebook) and I have been searching for someone who uses some method of flow charting first, and coding second, to tackle complex scenarios. I believe I have found that after watching your Arduino Nerf Target Alarm Clock and this tutorial. Thank you so much. Also, if you are interested in being commissioned for Arduino coding, please contact me.
@TheNormalUniverse
@TheNormalUniverse 5 років тому
Glad I could help! Thanks for letting me know. Sorry no commission work for me. I’d rather work on videos.
@drewwilliams2670
@drewwilliams2670 6 років тому
Great video!
@loopinout
@loopinout 4 роки тому
Thank you for helpful video!
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
Thanks for letting me know! It always makes me smile. Video about automatic curtains coming up.
@tokitahmid6641
@tokitahmid6641 2 роки тому
Thank you . You Work hard for this video . Again Thanks .
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
I did, but luckily people have continued to watch this vid ever since I uploaded it. It gets about 750 views per month from search traffic. Thanks for the nice comment!
@tokitahmid6641
@tokitahmid6641 2 роки тому
@@TheNormalUniverse i am waiting for to watch informative , nice, unique arduino videos
@Olavotemrazaodenovo
@Olavotemrazaodenovo 4 роки тому
Congratulations from Brazil.
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
Thanks for letting me know people are watching this all the way in Brazil!
@johnpriester1375
@johnpriester1375 4 роки тому
Awesome! You really have a gift for explaining this stuff. I am new to programming, but I have been on this planet for quite a while. My current project is a Softball scoreboard using Arduino & an RF remote. Now I can use a state machine. Also, don't let the haters suppress your sense of humor! Life is too short not laugh. Where can I get the plans for the Nerf Alarm Clock. Love it!
@TheNormalUniverse
@TheNormalUniverse 4 роки тому
Thanks for the nice comment! This video is definitely for a select group of nerds so I'm happy people are watching it. No worries I believe in being myself at full speed. I think I've only had 1 or 2 negative comments on this video so it's not a big trend. Sorry I didn't create plans for the clock and don't plan to dive back into that project.
@Zubairkhan-rb1fx
@Zubairkhan-rb1fx 2 роки тому
Great video
@TheNormalUniverse
@TheNormalUniverse 2 роки тому
Thank you Zabir!
#BB5 Moving your Arduino to a multi-tasking State Machine - Easy Intro
24:10
How to Use Millis to Master Arduino Multi-tasking
50:17
Rachel De Barros
Переглядів 42 тис.
Level Up Your Arduino Code: Registers
21:09
SparkFun Electronics
Переглядів 180 тис.
Arduino Tutorial on Finite State Machine Implementation
22:00
#224 🛑 STOP using Serial.print in your Arduino code! THIS is better.
26:39
Arduino Basics 102: Control Structures, Variables, Interrupts
7:38
GreatScott!
Переглядів 485 тис.
Level Up Your Arduino Code: Timer Interrupts
17:22
SparkFun Electronics
Переглядів 224 тис.
How to do multiple tasks in Arduino | Beginners | millis() function
10:23
Intro to Mechanical Engineering Drawing
15:05
Normal Universe - Chris Guichet
Переглядів 665 тис.
Сомнительно... Ну Окэй... Распаковал Nothing Phone (2a)
16:19
РасПаковка ДваПаковка
Переглядів 56 тис.
Which Phone Unlock Code Will You Choose? 🤔️
0:12
Game9bit
Переглядів 5 млн
Как открыть дверь в Jaecoo J8? Удобно?🤔😊
0:27
Суворкин Сергей
Переглядів 817 тис.
Лучший телефон на андроиде?
0:25
Опросный
Переглядів 92 тис.
Why spend $10.000 on a flashlight when these are $200🗿
0:12
NIGHTOPERATOR
Переглядів 16 млн