public void UpdateValue() { value = sketch.GetPinValue(number); numericUpDown1.Value = value; graph.Add(value); led.Image = value > 0 ? Properties.Resources.on : Properties.Resources.off; }
private IEnumerable <ExecutionSnapshot> getSnapshots(IEnumerable <byte> pins) { sketch.WriteSerial(program); while (currentTime <= targetTime) { sketch.SetMillis(currentTime); sketch.Loop(); ExecutionSnapshot currentSnapshot = new ExecutionSnapshot(); currentSnapshot.ms = currentTime; for (int i = 0; i < currentSnapshot.pins.Length; i++) { currentSnapshot.pins[i] = (byte)(pins.Contains(pinMap[i]) ? (sketch.GetPinValue(pinMap[i]) == 0 ? 0 : 1) : 0); } yield return(currentSnapshot); currentTime++; } }