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 TH-cam. I used it a LOT! Thanks for all your efforts.😊
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 TH-cam, 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 TH-cam. 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 TH-cam 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!
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!
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.
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.
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...!
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
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!
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.
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 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
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
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!
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.
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
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
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.
@@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
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.
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.
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
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.
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 !!
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!
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!
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.
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.
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.
@@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.
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!
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.
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.
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
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!
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!
9:06 when a coder edits a video. 🤠 I should add that this is excellent content. There is a lot of good stuff on TH-cam 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.
I'm very familiar with state machines, but not as much in the arduino/C++ ecosystem. This was awesome. It answers a few lingering questions I had. Thanks!
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.
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.
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)
Great vedio bro. I'm surprised watching how much effort you put in to make this one of a kind vedio in TH-cam. Even after 3 year this stands relevent entertaining and very informative.
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!
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!
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
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
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!
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.
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...
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.
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.
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.
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!
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)]
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!
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.
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.
Dude! Seriously your REALLY GOOD at making videos! I've been watching A LOT of TH-cam 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!
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...
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.
@@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.
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.
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.
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.
Thank you for the video! You could do more like this one. How do you code without a white or black background of an IDE? What is the tool you use to code? A low background music would not be a bad idea, ok, there was a stubborn noise as you talked.
Thanks for the nice comment! -For the black background, I googled "Arduino IDE dark theme" -I used the Arduino IDE in this video -Sorry about the stubborn noise. I was screen recording on my iMac to capture the code, which cased the iMac to run its fans.
Great video, I've currently completed one project with millis() and the second is under construction. Both work but the code is kinda a mess, not to mention that I was coding without a diagram/flowchart which was a headache. I feel like I have to implement this method to get more reliable on my projects.
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
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!
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.
I am only just getting started with Arduino, but trying to make a project that operates a different "switch" each time there is an input. I have it working for one input one output, but it now seems a State Machine is a good solution to get it to "trigger" a different function each time it detects an input.
the Serial.begin(###); sets the baud rate for the bus. 9600 would be 9.6kbps, 115200 is 115.2kbps, etc. There are reasons for selecting different (optimal) baud rates based on the processing speed to reduce messaging errors.
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 !
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.
Cool video this convinced me to try and mix up different statemachines like you: 1 for the button one for the LED. However I come from an era where memory was an issue. This is also the case for an Arduino. Try using #define for the naming of your cases and pinNumbers. Also for example you don't need an unsigned long for the interval of 5 millis.
Hi Peter, i filmed my face with a camera while coding, and also recorded the screen on my computer using QuickTime. In my video editor Final Cut Pro, I layered the screen capture coding video on top of the video on my face. Then, I used a “chroma key” to make the background color of my coding screen transparent, leaving only the text visible and revealing my face.
@@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.
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 :)
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!
Thank you Douglas! Here was my process for the code overlays: -cover the windows of my garage with tinfoil so the room is dark -shine lights on my face so I’m well lit but the background is dark -use a “night mode” theme for the arduino code editor -set up a camera to film my face, at the same time write code on my computer and screen record -in Final Cut Pro, I put the screen record footage on top of the footage from my camera that shows my face -in Final Cut Pro, use a “chroma key” to make the background around the code transparent. It’s sort of like a green screen effect. You tell final cut a particular color to make transparent. So the code is still visible but the background around the code disappears and reveals the camera footage of my face and garage. If I do it again I’ll try to find a more elegant solution. A lot of twitch streamers have setups that are more complex that work in real time instead of requiring Final Cut Pro editing. I hope that makes sense. Thanks!
@@TheNormalUniverse That makes perfect sense. Wow! What a lot of work! But it came off very well. If you come up with a more elegant solution please let us know. Something with less work would be great I think I may be too lazy for this!
That's a great tutorial. Please make more videos on Arduino programming. One problem though, I still get multiple triggers even after adding the hold state to state machine. What could be the problem ?
Glad you liked it! Hard to say what the root cause of your bug is. As I suggest in the video start by printing out how your state machine is flowing through the states.
28:03 - oooh, that's a cute little construction! Nice idea! I may have to imitate that. :) Nice video overall, too. Now, if only we could represent the state machine in a way that built both the code and the diagram.... ;)
You're welcome Prem! I'm glad people are liking this video. It's so long I was worried that no one would stick with it. What project did this help you with?
@@TheNormalUniverse Funny enough, I am trying to make a clock and that's were am planning on using this but, am sure I will use State Mechanics in all my future projects. I have already started to use it in my clock project to improve its efficiency. I watched several other videos to try and figure it out switch debouncing but only your video helped. I have used Serial Monitors to debug before but it never once hit me to use if(state_prev_s1 != state_s1) as a condition to stop the annoying repeating messages. Yes, your video was long but it was packed with information and clear explanations. I didn't once rewind the video to figure out what you were saying because it was so clear. The On-screen Code and the way the editing was done really helped a lot. I read that in one of the other comments that it took over a year to put this video together, it was evident in the quality of the video. Thanks for all the hard work and time you spent on this video. I wish I can donate some money for the channel, As of now am only a student so am sorry.
@@TheNormalUniverse It was more than Helpful it was also inspiring. After watching your video it inculcated some patience it helps me in debugging issues.
Thanks Mark! Glad you liked it. This video is definitely for advanced nerds only. This is the peak of my arduino knowledge so I probably won't me making pure coding videos for a while until I learn more.
This video is awesome and has such a beautiful explanation. I'm wondering why I get a steady stream of triggered messages and have been trying to troubleshoot it for hours. If anyone has any ideas and wants to help me figure that out that would be awesome! Thanks for the video
thanks for letting me know. I might have addressed your issue in this video. The first state machine I showed actually doesn't work. That was done on purpose so that I could show what debugging looks like. On your end, it could be a thousand things, but my tip is to print out the state every time it changes. That might point you in the right direction.
@@TheNormalUniverse Thank you so much! I am still learning so much from this video. My original issue was because I was using an analog pin to try making a button trigger based on high and low voltage and thought that this code would work the same way while using a pot or analog sensor. However, that was when my understanding of HIGH vs LOW was backwards. Watching this video again helped me realize LOW means low voltage, which in turn means digital signals are grounded when a button is pressed. That taught me how high and low works to the point of me never forgetting it lol. And then! I did jump the gun and forgot about that 5th armed case, just like you mentioned here in the comment. lol. Making these mistakes really helped me out. I know the first mistake was my own doing. But then you not putting that 5th case in the ino file further helped me figure this stuff out! Thank you! Sounds like you are well acquainted in understanding people with adhd! haha.
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 TH-cam. I used it a LOT!
Thanks for all your efforts.😊
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 TH-cam, 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 TH-cam. 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 TH-cam 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!
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!
Agreed. You killed me with the Nerf gun alarm clock! We are proud nerds 💯
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.
Thank you! Don't change anything about how you do your videos. They're great. Congratulations on your approach.
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.
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.
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...!
Thanks for letting me know!
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
Naboulsi Khalid thanks Naboulsi! I’m always quite jazzed that people are enjoying this video ^_^
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!
Thanks for the nice comment! This video really is my best work haha, but it took a year in between work and life.
Just learning state machines and this is a very simple and understandable code. Like how you walked through Code evaluation and changes.
Thanks for letting me know Steve! Glad you liked it
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.
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!
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 🙂
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!!
@@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
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
I’m glad the video helped you! Thanks for letting me know
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!
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.
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
Glad you enjoyed it! Thanks for letting me know
Beautifully done (Yes, I find beauty in coding, state machines and Arduino boards) Very, very useful tutorial. I'll recommend to everyone I know.
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
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.
@@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
@@nen848 voidstarlabs is amazing! thanks again
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.
Jeff hell yeah! I’m also self taught, so maybe that’s why we jive.
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.
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.
the view of you writing code while also showing your face is really good.
Thanks! I was really proud of that effect to make the code section less bland
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
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
Let go man just be yourself, you're giving off nervous energy. Fantastic video and very well explained.
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.
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 !!
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!
i always used to write delay() but after watching this video i can already see possibilities of multitasking
awesome! you're on the right track
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!
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.
Dude! Excellent video!
Easy to follow with top tier production value.
Keep em coming! Subscribed and liked!
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.
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.
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.
Most helpful (and entertaining) Arduino tutorial EVER!!!
Thanks for letting me know! This video is my magnum opus
I learned so much from this, I never understood how to use CASE until I watched this video. Thanks!
yeah boye that's like 20 minutes into the video. Thanks for watching!
@@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.
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!
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.
Thanks for sticking through such a long video and letting me know Evan! Glad it was helpful for you.
This is a fantastic video, especially liked the code overlay on the video while you explained it. Subbed for more
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.
the best effects usually take a lot of time but pay off in spades
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
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!
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.
Thanks Fabrizio! Glad you liked it.
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!
Awesome! I have a big smile on my face. May your arduino projects be successful. Tchau!
9:06 when a coder edits a video. 🤠
I should add that this is excellent content. There is a lot of good stuff on TH-cam 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.
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
I'm very familiar with state machines, but not as much in the arduino/C++ ecosystem. This was awesome. It answers a few lingering questions I had. Thanks!
Great! Thanks for letting me know
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.
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.
This is soooooooooo high quality, I can't believe I found this amongst very unwatchable videos
great! now I just need to pick up the pacing haha. I have trouble getting the words out
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.
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)
Great vedio bro. I'm surprised watching how much effort you put in to make this one of a kind vedio in TH-cam.
Even after 3 year this stands relevent entertaining and very informative.
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!
@@TheNormalUniverse pretty excited to see that.. all the best
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!
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
This is probably the 2nd video I hav commented on. Thanks for the great tutorial
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
This is a very well put together video! Keep them coming!
A Baby Eskimo thanks for the motivation!
I took two pages of notes, thank you soooo much for your exceptional video!!!
Awesome! Thanks for sticking through such a long vid!
thats a well done piece of work there, amazing
thanks JP!
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!
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.
bowhunters unlimited!!!! this is awesome! love the archery range.
Thanks! I just got into archery at the time and needed some random topic to talk about to use as an example
My lab mates and I had a good laugh about the coincidence of these two areas. Cheers!
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...
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.
This video is so amazing! I am doing Arduino Project now and it helps me a lot! Please, please update more videos!
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.
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.
with great power comes great responsibility
I'm a little embarassed I called my blinking lights "great power" *facepalm emoji*
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
ravin pijitham great! I’m glad it helped
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.
Glad I could help! Thanks for letting me know. Sorry no commission work for me. I’d rather work on videos.
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!
I loved the video's style and content. Thank you very much!
Thanks for letting me know! I'm most proud of this vid and my vid on mechanical drawing
Great video. I use state machines in my projects at work. The next step is state machines using function pointers.
haha this video is totally the peak of my understanding of coding. Will need to learn pointers some day
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)]
Man you saved my project. Love ur videos
haha thanks! I'm happy that someone used my tips! how did you find the video?
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!
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.
Thanks, never saw a better Arduino tutorial :)
Pat Rick thanks Mr. Rick!
Underrated video, thanks man this helped me alot.
Thanks sonu! Glad it helped
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.
+AdaBill thanks for the nice comment! We need to get the young ones hooked ASAP!
Dude! Seriously your REALLY GOOD at making videos! I've been watching A LOT of TH-cam 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!
Thanks for letting me know! Glad the video was helpful for you
great tutorial. all the best for you .
Thank you for letting me know Anwar! I'm going to start making coding videos again soon about synthesizers
The State machine to me a Novice hobbyist resembles elements of XOD. A very interesting concept I shall study.
Nice video its best video for ardiuno learner's
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...
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.
@@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.
Super helpful! Please make more of these Arduino tutorials!
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.
Subbed and liked, i really like the way you explain things! I hope you do continue making arduino tutorials! Thank you.
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.
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.
very impressive presentation
thank you!
Thank you for the video! You could do more like this one. How do you code without a white or black background of an IDE? What is the tool you use to code? A low background music would not be a bad idea, ok, there was a stubborn noise as you talked.
Thanks for the nice comment!
-For the black background, I googled "Arduino IDE dark theme"
-I used the Arduino IDE in this video
-Sorry about the stubborn noise. I was screen recording on my iMac to capture the code, which cased the iMac to run its fans.
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>
thanks for letting me know Cody! editing a teardown video right now
Great video, I've currently completed one project with millis() and the second is under construction. Both work but the code is kinda a mess, not to mention that I was coding without a diagram/flowchart which was a headache. I feel like I have to implement this method to get more reliable on my projects.
Awesome! Glad you like it
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
This is Absolutely Beautiful!
Thanks Atlas! It was definitely my peak. Most proud of the way I showed the code
Fantastic and entertaining video!
thanks Toshan!
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!
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.
This is a greatly built video and really useful!!!! Thanks a lot!!! It can show that you have spent time doing this video!!!
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?
@@TheNormalUniverse really useful!!, I'm just getting started with arduino and the state machine concept!
I am only just getting started with Arduino, but trying to make a project that operates a different "switch" each time there is an input. I have it working for one input one output, but it now seems a State Machine is a good solution to get it to "trigger" a different function each time it detects an input.
the Serial.begin(###); sets the baud rate for the bus. 9600 would be 9.6kbps, 115200 is 115.2kbps, etc. There are reasons for selecting different (optimal) baud rates based on the processing speed to reduce messaging errors.
Fantastic video! Very well made and very well explained, really helped me a lot with my project :)
awesome! thanks for letting me know. This video is my baby
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 !
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.
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.
Cool video this convinced me to try and mix up different statemachines like you: 1 for the button one for the LED. However I come from an era where memory was an issue. This is also the case for an Arduino. Try using #define for the naming of your cases and pinNumbers. Also for example you don't need an unsigned long for the interval of 5 millis.
Silly me... then they can't be compared so sorry about the remark. Unsigned long is fine... The #defines however can make your program more readable.
Ya I think using #define is definitely the right way to go. Thanks for the nice feedback on my vid!
How to you overlay your picture on top of a background with codes please? What tools do you use? Can you share with us please?
Hi Peter, i filmed my face with a camera while coding, and also recorded the screen on my computer using QuickTime. In my video editor Final Cut Pro, I layered the screen capture coding video on top of the video on my face. Then, I used a “chroma key” to make the background color of my coding screen transparent, leaving only the text visible and revealing my face.
Excellent video.
Zacson Skaria thanks Zacson! It’s definitely my MAHSTAPIECE!
Laser teacher is cool
This video should have at least 500k views after 4 years, not 50k :/
It’s ok, this vid is for a highly exclusive group of nerds. Thanks for letting me know you like it though!
Awesome video! Enjoyed !
great! thanks for letting me know
@@TheNormalUniverse I love the approach and contents itself is wholesome. My greetings from far Ukraine!
Congratulations from Brazil.
Thanks for letting me know people are watching this all the way in Brazil!
i learned something new and i loved it
Thanks for letting me know Naveen!
@@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.
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 :)
@@TheNormalUniverse 😇😇😇please continue making these amazing videos.
Congratulations from india👏👏👏
Thanks Kalesh!
Thank you . You Work hard for this video . Again Thanks .
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!
@@TheNormalUniverse i am waiting for to watch informative , nice, unique arduino videos
great video, Very helpful!
thanks for letting me know!
That was very well produced! Could you see if you words about how you did the video overlays?
Thank you Douglas! Here was my process for the code overlays:
-cover the windows of my garage with tinfoil so the room is dark
-shine lights on my face so I’m well lit but the background is dark
-use a “night mode” theme for the arduino code editor
-set up a camera to film my face, at the same time write code on my computer and screen record
-in Final Cut Pro, I put the screen record footage on top of the footage from my camera that shows my face
-in Final Cut Pro, use a “chroma key” to make the background around the code transparent. It’s sort of like a green screen effect. You tell final cut a particular color to make transparent. So the code is still visible but the background around the code disappears and reveals the camera footage of my face and garage.
If I do it again I’ll try to find a more elegant solution. A lot of twitch streamers have setups that are more complex that work in real time instead of requiring Final Cut Pro editing.
I hope that makes sense. Thanks!
@@TheNormalUniverse That makes perfect sense. Wow! What a lot of work! But it came off very well. If you come up with a more elegant solution please let us know. Something with less work would be great I think I may be too lazy for this!
good bro.
That's a great tutorial. Please make more videos on Arduino programming. One problem though, I still get multiple triggers even after adding the hold state to state machine. What could be the problem ?
Glad you liked it! Hard to say what the root cause of your bug is. As I suggest in the video start by printing out how your state machine is flowing through the states.
@@TheNormalUniverse Figured it out. My Serial.print was in the wrong state. Thanks for the replying :)
28:03 - oooh, that's a cute little construction! Nice idea! I may have to imitate that. :)
Nice video overall, too. Now, if only we could represent the state machine in a way that built both the code and the diagram.... ;)
Thanks for the nice comment!
@@TheNormalUniverse gladly. :)
Bro, I can't find enough words in the dictionary to thank you.
You're welcome Prem! I'm glad people are liking this video. It's so long I was worried that no one would stick with it. What project did this help you with?
@@TheNormalUniverse Funny enough, I am trying to make a clock and that's were am planning on using this but, am sure I will use State Mechanics in all my future projects. I have already started to use it in my clock project to improve its efficiency. I watched several other videos to try and figure it out switch debouncing but only your video helped. I have used Serial Monitors to debug before but it never once hit me to use if(state_prev_s1 != state_s1) as a condition to stop the annoying repeating messages. Yes, your video was long but it was packed with information and clear explanations. I didn't once rewind the video to figure out what you were saying because it was so clear. The On-screen Code and the way the editing was done really helped a lot. I read that in one of the other comments that it took over a year to put this video together, it was evident in the quality of the video. Thanks for all the hard work and time you spent on this video. I wish I can donate some money for the channel, As of now am only a student so am sorry.
@@ppkannanprem007 Much love! Thanks for letting me know it helped you. That's all I need! *thumbs up emoji*
@@TheNormalUniverse It was more than Helpful it was also inspiring. After watching your video it inculcated some patience it helps me in debugging issues.
You’re back!
awesome video - great examples :)
Mickey Mouse great to hear! I’m really glad people still watch this vid even though it’s 30 minutes. It’s my baby.
Great video! Make more arduino videos
Thanks Mark! Glad you liked it. This video is definitely for advanced nerds only. This is the peak of my arduino knowledge so I probably won't me making pure coding videos for a while until I learn more.
This video is awesome and has such a beautiful explanation. I'm wondering why I get a steady stream of triggered messages and have been trying to troubleshoot it for hours. If anyone has any ideas and wants to help me figure that out that would be awesome! Thanks for the video
thanks for letting me know. I might have addressed your issue in this video. The first state machine I showed actually doesn't work. That was done on purpose so that I could show what debugging looks like. On your end, it could be a thousand things, but my tip is to print out the state every time it changes. That might point you in the right direction.
@@TheNormalUniverse Thank you so much! I am still learning so much from this video.
My original issue was because I was using an analog pin to try making a button trigger based on high and low voltage and thought that this code would work the same way while using a pot or analog sensor. However, that was when my understanding of HIGH vs LOW was backwards. Watching this video again helped me realize LOW means low voltage, which in turn means digital signals are grounded when a button is pressed. That taught me how high and low works to the point of me never forgetting it lol. And then! I did jump the gun and forgot about that 5th armed case, just like you mentioned here in the comment. lol. Making these mistakes really helped me out. I know the first mistake was my own doing. But then you not putting that 5th case in the ino file further helped me figure this stuff out! Thank you! Sounds like you are well acquainted in understanding people with adhd! haha.