MENU

Fun & Interesting

#BB6 Arduino State😲Machine - Part 2: Implementation 🥳🥂

Ralph S Bacon 30,600 lượt xem 3 years ago
Video Not Working? Fix It Now

Finite State Machine - Part Two
► PCBWay $5 for 10 pieces https://www.pcbway.com

This is PART TWO of the Bacon Bytes series on a step-by-step guide on how we can move to a State Machine on the Arduino (or, indeed, any other microcontroller).

► Sketch and more in my GitHub for this video:
https://github.com/RalphBacon/BB6-Arduino-State-Machine-Part-2

To get the most of of this video ensure you have watched PART ONE first which covers the whole multitasking element of a useful State Machine that doesn't include any blocking code (such as use of the delay() 😲 statement).
Link: https://youtu.be/hwEo49yyU88

We briefly (ever so briefly) touch on theory😲but really concentrate on converting a State Diagram into actual Arduino-speak C++ code. It's far easier than you might think.

Moreover, it ensures your code reflects the State Diagram you draw, thus ensuring excellent robustness in your code.

You know about "enum"s? What about "class enum"s? We cover that too, and why it makes for better, more robust code.

If you really want some in-depth theory, Wikipedia has it covered:
https://en.wikipedia.org/wiki/Finite-state_machine

Perhaps in a future video we might even talk about Hierarchical State machines 😲

► Sketch and more in my GitHub for this video:
https://github.com/RalphBacon/BB6-Arduino-State-Machine-Part-2

► List of all my videos
(Special thanks to Michael Kurt Vogel for compiling this)
http://bit.ly/YouTubeVideoList-RalphBacon

► If you like this video please give it a thumbs up, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite (and other μControllers) journey

My channel, GitHub and blog are here:
------------------------------------------------------------------
• https://www.youtube.com/RalphBacon
• https://ralphbacon.blog
• https://github.com/RalphBacon
• https://buymeacoffee.com/ralphbacon
------------------------------------------------------------------

Comment