Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.92 KB

20240417_led_matrix_max7219_spi_web.md

File metadata and controls

42 lines (28 loc) · 1.92 KB
title date tags
LED Matrix with SPI MAX7219
2024-04-17
Pi4J
SPI
MAX7219
BME280

2024-04-18, by Frank Delporte

Roberto Marquez shared a project with us that uses Java to interface with a MAX7219 SPI device to control an LED matrix. It's inspired by the blog Raspberry Pi and SPI 8×8 LED matrix example with Java and Pi4j, but differs in that it is Web-enabled via Spring Boot. This project is the starting point to create a weather station in combination with the BMP280, see BME280 Sensor (temp, humidity, pressure) via Pi4J, I2C, and JBang.

{{< gallery >}} {{< figure link="/assets/blogs/max7219/wiring-diagram.png" caption="Wiring diagram" caption-position="center" caption-effect="fade" >}} {{< figure link="/assets/blogs/max7219/number-8-definition.png" caption="Definition of the number 8 for the LED matrix" caption-position="center" caption-effect="fade" >}} {{< /gallery >}} {{< load-photoswipe >}}

While working on his project, Roberto contributed extra LED character definitions for the Pi4JLedMatrixSpi.java single-file application in the Pi4J V2 JBang project.

Demos

Wiring

This demo project uses:

  • Raspberry Pi 2 Model B V1.1
  • 8x8 LED Matrix with Max7219 SPI

Connections:

  • DIN -> blue -> MOSI -> header 19
  • CS -> purple -> CE0 -> header 24
  • CLK -> white -> SCLK -> header 23
  • VCC -> 5V -> header 2
  • GND -> ground -> header 9

Project and Code

Check the README in the project sources of Roberto for more info.