public static void Main() { var leds = new[] { new OutputPort(Stm32F4Discovery.LedPins.Green, true), new OutputPort(Stm32F4Discovery.LedPins.Orange, true), new OutputPort(Stm32F4Discovery.LedPins.Red, true), new OutputPort(Stm32F4Discovery.LedPins.Blue, true) }; var rotator = new LedRotator(leds); DirectionLed.Write(rotator.Right); UserButton.OnInterrupt += (u, data2, time) => { rotator.ChangeDirection(); DirectionLed.Write(rotator.Right); UserButton.ClearInterrupt(); }; Blink(leds, 6); rotator.Run(); }