016 - MakeCode MicroBit: Brickcell 8x16 Dot Matrix Display
Table of Contents
Brickcell 8x16 Dot Matrix Display (MAX7219)
Please refer to the previous article about the Brickcell 8x8 Dot Matrix Display for basic concepts and wiring overview.
Hardware Instruction
Let's explore how to connect the Dot Matrix Display module (MAX7219) with SPI interface to a micro:bit microcontroller and use MakeCode for programming.
- Connect the MAX7219 Dot Matrix display GND pin to micro:bit GND pin.
- Connect the MAX7219 Dot Matrix display VCC pin to micro:bit 3V3 pin.
- Connect the MAX7219 Dot Matrix display serial data input pin (DIN) to micro:bit pin 15.
- Connect the MAX7219 Dot Matrix display serial clock pin (CLK) to micro:bit pin 14.
- Connect the MAX7219 Dot Matrix display chip select pin (CS) to micro:bit pin 13.
Software Instruction
Now, let’s start programming the micro:bit to utilize the 8x16 MAX7219 Dot Matrix Display module.
- Login to https://makecode.microbit.org/ using your Microsoft account.
- Create a new project by clicking the "New Project" button. You may name it something descriptive such as dotmatrix-8x16-max7219-test.
- Click the "Extensions" option under the "Math" category.
- Type https://github.com/gbantique/brickcell-dotmatrix-max7219/ into the search bar.
- Select brickcell-dotmatrix-max7219 from the search results. The "dotmatrix max7219" block will appear under the Brickcell category.
- Copy and paste the code below into your MakeCode editor:
let max7219 = Brickcell.create()
max7219.setup(
2,
DigitalPin.P15,
DigitalPin.P14,
DigitalPin.P13,
DigitalPin.P16,
max7219_rotation_direction.counterclockwise,
true
)
basic.forever(function () {
max7219.scrollText(
"Brickcell 8x16 Dot Matrix Display",
150,
300
)
})
Or you can make a copy of my created project directly into your MakeCode workspace:
https://makecode.microbit.org/S95123-37868-60000-90667/
Expected Result
If you carefully follow the instructions above, you should see a scrolling text message: "Brickcell 8x16 Dot Matrix Display" displayed on the LED matrix.