Circuit Biscuits

Lesson 3 - Commands Modes And State Pupil Notes

The same firmware can switch between different behaviours. We use commands to move between modes and learn that the board keeps track of its current state.

In This Lesson

Lesson 3 Pupil Notes

Title

Commands, Modes, And State

Big Question

How does one board behave like many different devices without changing the hardware?

What This Lesson Is About

The same firmware can switch between different behaviours. We use commands to move between modes and learn that the board keeps track of its current state.

Key Words

  • command
  • mode
  • state
  • protocol
  • UART
  • I2C
  • SPI

Before You Start

  • Connect to the board.
  • Open the status and log areas.
  • Be ready to compare what the dashboard says with what the board is doing.

What To Remember

  • a command is an instruction sent to the firmware
  • a mode is a named behaviour state
  • state means the board remembers what it is currently doing
  • protocols are agreed ways for devices to communicate
  • different parts of the system may use different protocols

What We Did

  • switched between modes
  • watched the status change
  • connected commands to device behaviour
  • compared UART, I2C, and SPI at a simple level

What To Look For

  • which parts of the dashboard change when the mode changes?
  • which actions seem to send commands, and which areas mainly display returned state?
  • what would go wrong if two parts of the system disagreed about a command?

Try This

  • Switch to TIME, TEXT, and one sensor-based mode.
  • Watch how the status panel changes after each command.
  • Record one example of a command causing a different mode.

Why It Matters

Real embedded products often support many behaviours without changing hardware. Commands and state make that possible.

Check Yourself

  • What is a mode?
  • What is state?
  • What is a protocol?
  • Which protocol in this course is linked to the HC-05?
  • Which protocol is linked to the MPU6050?

Reflection

  • One command and its effect:
  • One mode I tested:
  • One protocol I remember and where it is used: