Hi,
I have just bought GrovePi+ Starter Kit for Raspberry Pi.
I would like to display some messages from my code in Grove LCD RGB Backlight.
I use C# as my language.
I can confirm that GrovePi+ works fine because I tested LED and it works fine.
Here’s my sample code which I run on my Raspberry Pi.
using System;
using System.Device.Gpio;
using System.Device.I2c;
using System.Threading;
using System.Threading.Tasks;
using Iot.Device.CharacterLcd;
using Iot.Device.GrovePiDevice;
using Iot.Device.GrovePiDevice.Models;
using Iot.Device.GrovePiDevice.Sensors;
namespace helloworld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
I2cConnectionSettings i2CConnectionSettings =
new I2cConnectionSettings(1, GrovePi.DefaultI2cAddress);
var i2cDevice = I2cDevice.Create(i2CConnectionSettings);
var grovePi = new GrovePi(i2cDevice);
Console.WriteLine($"Manufacturer :{grovePi.GrovePiInfo.Manufacturer}");
Console.WriteLine($"Board: {grovePi.GrovePiInfo.Board}");
Console.WriteLine($"Firmware version: {grovePi.GrovePiInfo.SoftwareVersion}");
grovePi.PinMode(GrovePort.DigitalPin4, PinMode.Output);
grovePi.PinMode(GrovePort.DigitalPin3, PinMode.Output);
Led led = new Led(grovePi, GrovePort.DigitalPin4);
LcdRgb1602 display = new LcdRgb1602(i2cDevice, i2cDevice);
Task.Delay(100).Wait(); // Delay 0.1 second
display.BlinkingCursorVisible = true;
display.DisplayOn = true;
display.Write("Hello World");
display.BacklightOn = true;
int counter = 0;
while (true)
{
display.ShiftDisplayLeft();
led.Value = PinValue.High;
Console.WriteLine("High");
Task.Delay(2000).Wait();
display.Write($"Hello World {counter}");
led.Value = PinValue.Low;
Console.WriteLine("Low");
Task.Delay(2000).Wait();
counter++;
}
}
}
}
LED works fine but I cannot display any message on LCD.
Could you please give me any advice on how can I do it?