Presentation is loading. Please wait.

Presentation is loading. Please wait.

RPi2 SPI 8x8 Dot Matrix LED jyheo0@gmail.com.

Similar presentations


Presentation on theme: "RPi2 SPI 8x8 Dot Matrix LED jyheo0@gmail.com."— Presentation transcript:

1 RPi2 SPI 8x8 Dot Matrix LED

2 Raspberry Pi 2 SPI SPI? 8x8 Dot Matrix with MAX7219
Serial Peripheral Interface bus 직렬 주변기기 인터페이스 버스 8x8 Dot Matrix with MAX7219 MAX7219: SPI to 8x8 Dot matrix LED or 8 segments LED

3 Enable SPI & Install MAX7219 driver for Python
$ sudo raspi-config 8 Advanced options > A6 SPI > Yes (Would you like the SPI interface enabled?) > OK > Yes (Would you like the SPI kernel module to be loaded by default?) > OK reboot Install driver $ sudo apt-get install python-dev python-pip $ sudo pip install spidev $ git clone $ cd max7219 $ sudo python setup.py install

4 Wiring MAX7219 Name Remarks RPi Pin RPi Function VCC +5V Power 2 5V0
GND Ground 6 DIN Data In 19 GPIO 10 (MOSI) CS Chip Select 24 GPIO 8 (SPI CE0) CLK Clock 23 GPIO 11 (SPI CLK)

5 Running matrix_test.py
$ sudo python examples/matrix_test.py

6 How to use MAX7219 driver for Python
import max7219.led as led import time device = led.matrix() #device.show_message("Hello world!") for i in range(8): device.pixel(1, i, 1) time.sleep(0.5) device.pixel(1, i, 0)

7 Exercise! 버튼을 누를때마다 빨간 점(켜진 LED)을 이동하는 프로그램 버튼을 추가하고
버튼을 누를 때마다 현재 켜진 LED를 끄고 오른쪽 LED를 켬 오른쪽 끝까지 이동하면(7,3) 다시 왼쪽 끝(0,3)으로 이동 추가1 버튼을 두 개 만들고 빨간 점을 좌우로 이동시키는 프로그램 추가 2 버튼을 네 개 만들고 빨간 점을 좌우상하 이동시키는 프로그램


Download ppt "RPi2 SPI 8x8 Dot Matrix LED jyheo0@gmail.com."

Similar presentations


Ads by Google