Build the wiringPi on ubuntu
- NOTE for ODROID C users.
- Before starting this guide, you should check whether the 1-wire module is loaded or not. Because 1-wire and LCD_RS share the GPIOX_21 pin.
- target
$ lsmod Module Size Used by w1_gpio 3785 0 wire 25687 1 w1_gpio (...)
- If 1-wire module is loaded, then please unload the 1-wire modules.
- target
$ sudo modprobe -r w1_gpio
- Or, add “w1_gpio” in /etc/modprobe.d/blacklist-odroid.conf file.
To use the LCD-IO Shield with wiringPi you build the wiringPi library first.
1. Get the wiringPi library compatible ODROID Series.
- target
$ sudo apt install git $ git clone https://github.com/hardkernel/wiringPi
2. Build the library
- target
cd wiringPi ./build
Tutorials
Basic example
1. Get a source code.
example-lcd.c
- target
wget https://dn.odroid.com/source_peripherals/16x2lcdio/example-lcd.c
2. Compile & Run
- target
gcc -o example-lcd example-lcd.c -lwiringPi -lwiringPiDev -lm -lpthread -lrt -lcrypt sudo ./example-lcd
Display System Time
1. Get a source code.
lcd_time.c
- target
wget https://dn.odroid.com/source_peripherals/16x2lcdio/lcd_time.c
2. Compile & Run
- target
gcc -o lcd_time lcd_time.c -lwiringPi -lwiringPiDev -lm -lpthread -lrt -lcrypt sudo ./lcd_time
Interrupt example
1. Get a source code.
wiring_isr.c
- target
wget https://dn.odroid.com/source_peripherals/16x2lcdio/wiring_isr.c
2. Compile & Run
- target
gcc -o wiring_isr wiring_isr.c -lwiringPi -lwiringPiDev -lm -lpthread -lrt -lcrypt sudo ./wiring_isr
3. Push the SW1 on 16x2lcd board