示例#1
0
 void OverwriteRange(int rowIdx, Range r, List <char> row)
 {
     byte[] b = new byte[r.End - r.Start + 4];
     Array.Copy(new byte[] { 0x1f, 0x24, (byte)(r.Start + 1), (byte)(rowIdx + 1) }, b, 4);
     for (int i = r.Start; i < r.End; i++)
     {
         b[4 + i - r.Start] = (byte)row[i];
     }
     writer.Send(b);
 }
示例#2
0
 public VfdPanel(VfdWriter w, int brightness)
 {
     writer            = w;
     _Brightness       = brightness;
     _BrightnessBefore = brightness;
     w.Send(new byte[] { 0x0c /* clear */ });
     for (int i = 0; i < NUM_ROW; i++)
     {
         _Rows.Add(new List <char>("                    "));
     }
     foreach (var r in _Rows)
     {
         _RowsBefore.Add(new List <char>(r));
     }
     w.Send(new byte[] { 0x1f, 0x58, (byte)(Brightness + 1) }); // brightness
 }