Welcome, Guest
Username: Password: Secret Key Remember me

TOPIC: Finite State Machines

Re: Finite State Machines 6 years 10 months ago #16284

  • majenko
  • majenko's Avatar
  • Offline
  • Fresh Boarder
  • Thanks received: 62
Implement a "Finite State Machine."
But what actually is a "Finite State Machine"?

Put simply, a Finite State Machine (I'm bored with typing that now, let's call it an FSM - not to be confused with the Flying Spaghetti Monster, of course) is a computer program that, at any point in time, can be in one of a pre-determined number of states. A state is a specific action, such as "Waiting for button 3 to be pressed", or "Moving the servo to 69°", for example.

An FSM can replace most of your while, for and similar loops, as well as annoying functions such as delay which get in the way if you want to do more than one thing at a time.

Read full article...

Re: Finite State Machines 6 years 10 months ago #12105

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
Nice article Matt! FSM is probably why I am so frustrated with the Arduino world, since I use interrupts all time. Maybe you can showcase interrupts in your next sketch article?
Time to create page: 0.229 seconds