Episode 6 Putting It Together

Starting from a new hello world paradigm, we have introduced the concept of software design using statecharts and techniques of implementing statecharts on micro:bit with a simple framework. We have shown examples of representing states and events in Javascript and how a graphical design is 

Episode 5 Statechart Framework – event

In the previous episode, we introduced a simple statechart framework and learned how to represent leaf states with a Javascript enumeration. We also learned how to assign entry and exit actions to a leaf state such that they are automatically executed whenever the state is 

Episode 4 Statechart Framework – state

In the last episode, we introduced a statechart describing the behaviors of an alarm clock running on a micro:bit. Its operation is demonstrated in the following video: Microbit Timer (https://youtu.be/056EfSlMPCY) Statecharts are more than neat diagrams. Statechart is a visual language that precisely specifies how 

Episode 3 Event Meets State

Previously in our modernized “hello-world” example, we illustrated how to treat one of the most commonly used resources in computer programs, timers or timeout as events that can be handled in the same way as any other types of event (such as button presses). This 

Episode 2 Timeout as Events

In the last post we discussed the need for a new programming model for our “hello world” program. Our initial version uses a common sequential programming model in which actions (or code) are executed one by one in a loop. If a loop contains the 

Episode 1 A New “Hello World”

Almost every computer language or platform uses a “Hello World” program as the first example. For desktop or server environments, it typically prints the string “Hello World”. For embedded platforms such as a micro:bit, it simply blinks an LED. Some may think, “How hard could