Lesson plan

Build a macro pad lesson plan

Twelve keys, a volume knob, three layers and a screen on a Pro Micro that plugs in as a keyboard.

2 chapters, 3 lessons, about 2 hours, on the SparkFun Pro Micro. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • Read a key matrix, then send real shortcuts and media keys over USB.
  • Add layers, a lamp for each and a screen that shows what just happened.

Materials for the whole unit

  • Full-size breadboard
  • Keypad, 4x3 telephone
  • LED x 3
  • OLED display, 128x64
  • Resistor x 3
  • Rotary encoder, KY-040
  • SparkFun Pro Micro

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 10 min

Keys that type

Read a key matrix, then send real shortcuts and media keys over USB.

LessonTimeWhat students do
Twelve keys on seven pinsWire a keypad to a Pro Micro and read it with the Keypad library. Why a matrix saves pins, and how the board tells which key you pressed.35 min
  1. Meet the board
  2. Press a key
  3. Find a corner
  4. Let go
Become a USB keyboardTurn every key into a shortcut and add a knob that turns the volume. Why volume is a different kind of key, and how the board sends both.35 min
  1. One include, two devices
  2. Copy, the way your keyboard does it
  3. Two modifiers at once
  4. Turn it up

Materials

  • Full-size breadboard
  • Keypad, 4x3 telephone
  • Rotary encoder, KY-040
  • SparkFun Pro Micro

Check for understanding

Each student finishes "Become a USB keyboard" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Turn it up".

Chapter 2. About 45 min

The finished pad

Add layers, a lamp for each and a screen that shows what just happened.

LessonTimeWhat students do
Layers, lamps and a screenFinish the pad: three layers you switch with the knob, a lamp for each, and an OLED that shows what every key just did.45 min
  1. A lamp for every layer
  2. The screen
  3. Press the knob
  4. Keys that mean something new
  5. Play and pause

Materials

  • Full-size breadboard
  • Keypad, 4x3 telephone
  • LED x 3
  • OLED display, 128x64
  • Resistor x 3
  • Rotary encoder, KY-040
  • SparkFun Pro Micro

Check for understanding

Each student finishes "Layers, lamps and a screen" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Play and pause".

Your class

Teach this unit as a class

Start a class from this course and its 3 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.