Erlang/OTP Application for the 16x2 LCD with MCP23017 on Raspberry Pi.
This is a port of the Python source code to Erlang.
- MCP code inspired by MCP230xx
- LCD code inspired by Adafruit_CharLCD
At this time, the code and plate can control the white backlight on or off. There is no support for PWM control of the backlight at this time, so if you need to have more granular control of the backlight, this plate can't do that (the I2C expander does not have PWM output).
For more information on the product, prices and distributors, visit the Adafruit product page.
I got mine from Kjell and Company
lcd_app uses rebar3 as build tool.
rebar3 compile
rebar3 shell
pi@rpi02:~/adafruit_lcd $ rebar3 shell
===> Verifying dependencies...
===> Compiling lcd_app
make: Entering directory '/home/pi/adafruit_lcd/c_src'
cc -o ../priv/i2c_drv.so -fpic -shared -Wall -Wformat i2c_drv.c
make: Leaving directory '/home/pi/adafruit_lcd/c_src'
Erlang/OTP 18 [erts-7.3] [source] [smp:4:4] [async-threads:0] [kernel-poll:false]
Eshell V7.3 (abort with ^G)
1> ===> The rebar3 shell is a development tool; to deploy applications in production, consider using releases (http://www.rebar3.org/v3.0/docs/releases)
===> Booted lcd_app
1> lcd:message("HELLO!").
ok
2>
pi@rpi02:~/adafruit_lcd $ rebar3 shell
===> Verifying dependencies...
===> Compiling lcd_app
make: Entering directory '/home/pi/adafruit_lcd/c_src'
cc -o ../priv/i2c_drv.so -fpic -shared -Wall -Wformat i2c_drv.c
make: Leaving directory '/home/pi/adafruit_lcd/c_src'
Erlang/OTP 18 [erts-7.3] [source] [smp:4:4] [async-threads:0] [kernel-poll:false]
Eshell V7.3 (abort with ^G)
1> ===> The rebar3 shell is a development tool; to deploy applications in production, consider using releases (http://www.rebar3.org/v3.0/docs/releases)
===> Booted lcd_app
lcd:create_char(1, {2, 3, 2, 2, 14, 30, 12, 0}).
ok
2> lcd:clear().
ok
3> lcd:message([1]).
ok
4>
- clear/0,
- enable_display/1,
- show_cursor/1,
- message/1,
- home/0,
- set_cursor/2,
- blink/1,
- move_left/0,
- move_right/0,
- autoscroll/1
- backlight/1
- create_char/2
- Button support
- set_left_to_right
- set_right_to_left