示例#1
0
        private void btnSaveTimeSettings_Click(object sender, EventArgs e)
        {
            LEDText t = new LEDText();
            t.ticks2Begin = (UInt16)numTimeTicks2Begin.Value;
            t.ticks2End = (UInt16)numTimeTicks2End.Value;
            t.ticksBetween = (char)numTimeTicksBetween.Value;
            t.ticksPerScroll = (UInt16)numTimeTicksPerScroll.Value;
            t.scrollSpeed = (byte)numTimeScrollSpeed.Value;
            t.charWidth = (byte)numTimeCharWidth.Value;
            t.charSpace = (byte)numTimeCharSpace.Value;
            t.repeat = (byte)((cbTimeRepeat.Checked) ? 1 : 0);

            saveSettings(t, (char)0, (char)(cbSaveTimeSettingsInEEPROM.Checked ? 1 : 0));
        }
示例#2
0
        private void saveSettings(LEDText t, char action, char writeToEEPROM)
        {
            Byte[] arr = new Byte[2];
            arr[0] = 3;     // Text ändern
            arr[1] = (Byte)(cbSaveTextInEEPROM.Checked ? 1 : 0);  // in EEPROM speichern?
            byte[] arrS=t.getByteArray();

            Array.Resize(ref arr, 2 + arrS.Length);
            Array.Copy(arrS, 0, arr, 2, arrS.Length);

            SendBytes(arr);
        }