ok, i just tested it with LejOS and now i know, how to use it 😉 i must write to register 0x16 byte array 😉 and here is my test code
public static void Main (string[] args)
{
EventWaitHandle stopped = new ManualResetEvent (false);
ButtonEvents btn = new ButtonEvents ();
byte address = 0x70;
byte[] data1 = new byte[1] { 0x05 };
byte[] data0 = new byte[1] { 0x0A };
LcdConsole.WriteLine ("hello world!");
pcf pcf = new pcf (SensorPort.In1, address);
btn.EscapePressed += () => {
LcdConsole.WriteLine("stopped");
stopped.Set ();
};
btn.LeftPressed += () => {
pcf.WriteReg(0x16, data1);
LcdConsole.WriteLine("write data1");
};
btn.RightPressed += () => {
pcf.WriteReg(0x16, data0);
LcdConsole.WriteLine("write data0");
};
btn.EnterPressed += () => {
LcdConsole.WriteLine(BitConverter.ToString(pcf.ReadReg(16, 1)));
};
stopped.WaitOne ();
}
thanks for help 😉
Follow