I am trying to connect LCD1602 RBG Waveshare to the Raspberry using C#. I connected it to the Raspberry and set the permissions, now trying to pass some data. The code below run all lines, but the LCD is not reacting. If anyone can advise me.
using System;
using System.Device.Gpio;
using System.Threading.Tasks;
using System.Device.I2c;
using Iot.Device.CharacterLcd;
using Iot.Device.Pcx857x;
using System.Threading;
namespace pi_project
{
public class Program
{
static void Main(string[] args)
{
Console.WriteLine("Test1");
using I2cDevice i2c = I2cDevice.Create(new I2cConnectionSettings(1, 0x3e));
//BCM2835
using var driver = new Pcf8574(i2c);
using var lcd = new Lcd1602(registerSelectPin: 0,
enablePin: 2,
dataPins: new int[] { 4, 5, 6, 7 },
backlightPin: 3,
backlightBrightness: 0.3f,
readWritePin: 1,
controller: new GpioController(PinNumberingScheme.Logical, driver));
int counter = 0;
while (counter <= 4)
{
lcd.Clear();
lcd.SetCursorPosition(0, 0);
lcd.Write("TestText1");
lcd.SetCursorPosition(0, 1);
lcd.Write("TestText2");
Thread.Sleep(2000);
counter++;
}
}
}
}
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- 3e --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --