Object oriented state machine

Educational toy project to show how to write a simple object oriented state machine with your own class hierarchy.

Feb 24, 2018

6132 views

1 respects

Components and supplies

1

Breadboard (generic)

2

Resistor 221 ohm

2

LED (generic)

1

Arduino UNO

Apps and platforms

1

Arduino IDE

Project description

Code

OO State Machine

c_cpp

Simple example of an object oriented state machine with two states.

OO State Machine

c_cpp

Simple example of an object oriented state machine with two states.

Downloadable files

Fritzing diagram of state machine

Fritzing diagram of state machine

Comments

Only logged in users can leave comments

JanHendrikStam

6 years ago

Nice and simple to understand. I have made a FSM using a switch statement. Indeed lengthy and cumbersome to maintain/expand.