I'm trying to get a HD44780 working directly off the GPIO as per the sample on github,
However I can't get the configuration object to work, doing at as a dynamic doesn't work as per the PCF8574 example, nor does as per the ConfigurationLoader.cs method.
I get either missing an assembly or reference, or object doesnt contain definition for pins..
const ConnectorPin registerSelectPin = ConnectorPin.P1Pin22;
const ConnectorPin clockPin = ConnectorPin.P1Pin18;
var dataPins = new[]
{
ConnectorPin.P1Pin16,
ConnectorPin.P1Pin15,
ConnectorPin.P1Pin13,
ConnectorPin.P1Pin11
};
//var driver = GpioConnectionSettings.DefaultDriver;
Program.Notify ("LCD","1");
var driver = GpioConnectionSettings.DefaultDriver;
// dynamic configuration = new dynamic();
// configuration.Pins = new Hd44780Pins(
// driver.Out(registerSelectPin),
// driver.Out(clockPin),
// dataPins.Select(p => (IOutputBinaryPin)driver.Out(p)));
var configuration = new Hd44780Configuration
{
Pins = new Hd44780Pins(
driver.Out(registerSelectPin),
driver.Out(clockPin),
dataPins.Select(p => (IOutputBinaryPin)driver.Out(p)))
};
Program.Notify ("LCD","2");
var settings = new Hd44780LcdConnectionSettings
{
ScreenWidth = 40,
ScreenHeight = 4,
};
Program.Notify ("LCD","3");
using (var display = new Hd44780LcdConnection(settings, configuration.Pins))
{
Program.Notify ("LCD","4");
display.SetCustomCharacter(1, new byte[] {0x0, 0x0, 0x04, 0xe, 0x1f, 0x0, 0x0});
display.SetCustomCharacter(2, new byte[] {0x0, 0x0, 0x1f, 0xe, 0x04, 0x0, 0x0});
display.Clear();
display.WriteLine("R# IP Config");
}
// Bodge:
Program.GoBackground();
problem code is between notify for 1 and 2