SPI Dot-Matrix
ODROID-C1/C1+/C2
ODROID-XU4 W/ Shifter Shield
ODROID-N2
ODROID-C4
- LED Matrix Shield is available on this version of the kernel.
- ODORID-C2: 3.14.29-32 or higher
- ODROID-XU4: 3.10.82 or higher
- This guide is tested by,
- ODROID-C1+: ubuntu-16.04.2-mate-odroid-c1-20170220.img
- ODROID-XU4: ubuntu-16.04.2-mate-odroid-xu4-20170510.img
- ODROID-C4: TBD
Enable SPI
You have to enable SPI feature first to use this shield.
Please refer to this guide.
Make sure that the SPI feature on your Odroid is enabled correctly. A short way to check out is finding spidev file under /dev directory.
See the following.
- target
root@odroid:~# ll /dev/spidev* crw------- 1 root root 153, 0 Apr 3 09:17 /dev/spidev0.0
Compile / Run SPI test example code
Download our example code and run that.
- Example code: dot_test.c
- target
wget https://dn.odroid.com/Accessory/examples/Dot-Matrix/dot_test.c gcc -o dot_test dot_test.c
Execute that built file, and you can see the results like the below.
- target
odroid@odroid64:~$ sudo ./dot_test spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz)
- In Odroid-C2, although you set to 500 KHz, it actually operates at 390KHz since C2 runs SPI in the bit-banging method.
Another example: Scrolling text
Download our example code and run that.
- Example source code: dot_shift_test.c
- Its font file: dotfont.h
- target
wget https://dn.odroid.com/Accessory/examples/Dot-Matrix/dot_shift_test.c wget https://dn.odroid.com/Accessory/examples/Dot-Matrix/dotfont.h gcc -o dot_shift_test dot_shift_test.c
Execute that built file, and you can see the results like the below.
- target
odroid@odroid64:~$ sudo ./dot_shift_test max speed: 1000000 Hz (1000 KHz)
- Check this out if it doesn't work. Here is the help for WiringPi SPI APIs to edit the example file.
1. Uncomment this line first. #define USE_WIRING_PI_LIB 2. Change spidev node path if you need. dot_shift_test.c line 68-69 (Uncomment each model like the below) #define SPIDEV_NODE_NAME "/dev/spidev0.0" // ODROID-C1/C1+/C2/N2/C4 //#define SPIDEV_NODE_NAME "/dev/spidev1.0" // ODROID-XU3/XU4 3. Build that example with a proper library option. if defined USE_WIRING_PI_LIB Compile : gcc -o <create excute file name> <source file name> -lwiringPi -lwiringPiDev -lpthread else Compile : gcc -o <create excute file name> <source file name>