private RaspberryIRDotNet.IRPulseMessage LearnButton() { var ir = new RaspberryIRDotNet.RX.IRMessageLearn() { CaptureDevice = IRRXUtilities.RxDevicePath.Value, LeadInPattern = RaspberryIRDotNet.PulseSpaceUnitList.LoadFromString(RemoteConfig.LeadIn), MessageMinimumUnitCount = RemoteConfig.MinimumUnitCount, MessageMaximumUnitCount = RemoteConfig.MaximumUnitCount, UnitDurationMicrosecs = RemoteConfig.UnitDuration, }; IRRXUtilities.SetUpRxFeedback(ir); IRRXUtilities.WriteButtonPressInstructions("the button", false); return(ir.LearnMessage()); }
private RaspberryIRDotNet.IRPulseMessage LearnKey(string keyName, RaspberryIRDotNet.IReadOnlyPulseSpaceDurationList leadInDurations, int unitDuration, int unitCount) { var recorder = new RaspberryIRDotNet.RX.IRMessageLearn() { CaptureDevice = DemoConfig.GetRxDevice(), UnitDurationMicrosecs = unitDuration, MessageMinimumUnitCount = unitCount, MessageMaximumUnitCount = unitCount }; recorder.SetLeadInPatternAsMicrosecs(leadInDurations); SetUpRxFeedback(recorder); WriteKeyPressInstructions($"the '{keyName}' key", false); var result = recorder.LearnMessage(); Console.WriteLine("Key captured."); Breather(); return(result); }