コード例 #1
0
    public static void Main()
    {
        DigitalLed        led        = new DigitalLed(Pin.Pin0);
        IDigitalInterrupt startTests = Signals.DigitalInterrupt.Bind(Pin.Pin1, "Restart Testing", ResistorMode.PullUp, InterruptMode.InterruptEdgeLow, 50);
        var input = new GpioInput(startTests);

        LedTestHarness.RunTests(Assembly.GetExecutingAssembly(), led, input);
    }
コード例 #2
0
ファイル: EmulatorButtons.cs プロジェクト: valoni/uScoober
        public EmulatorButtons()
        {
            _startTests = Signals.DigitalInterrupt.Bind(EmulatorPins.Select, "Restart Tests", ResistorMode.PullUp, InterruptMode.InterruptEdgeLow);

            _scrollUp = Signals.DigitalInterrupt.Bind(EmulatorPins.Up, "Scroll Up", ResistorMode.PullUp, InterruptMode.InterruptEdgeLow);

            _scrollDown = Signals.DigitalInterrupt.Bind(EmulatorPins.Down, "Scroll Down", ResistorMode.PullUp, InterruptMode.InterruptEdgeLow);
        }
コード例 #3
0
    public static void Main()
    {
        DigitalLed        led        = new DigitalLed((Pin)SecretLabsPinAssignment.ONBOARD_LED);
        IDigitalInterrupt startTests = Signals.DigitalInterrupt.Bind((Pin)SecretLabsPinAssignment.GPIO_PIN_D0,
                                                                     "Restart Testing",
                                                                     ResistorMode.PullUp,
                                                                     InterruptMode.InterruptEdgeLow,
                                                                     50);
        var input = new GpioInput(startTests);

        LedTestHarness.RunTests(Assembly.GetExecutingAssembly(), led, input);
    }
コード例 #4
0
    public static void Main()
    {
        /*  Pick a driver that matches your hardware setup */
        IDriveTextDisplays driver = null;

        CharacterDisplay lcd = new CharacterDisplay(20, 4, driver)
        {
            IsCursorBlinking   = false,
            IsCursorUnderlined = false
        };

        /* Hook user input buttons */
        IDigitalInterrupt startTests = Signals.DigitalInterrupt.Bind(Pin.Pin1, "Restart Testing", ResistorMode.PullUp, InterruptMode.InterruptEdgeLow, 50);
        var input = new GpioInput(startTests);

        /* Run the tests */
        lcd.ClearScreen();
        TextTestHarness.RunTests(Assembly.GetExecutingAssembly(), lcd, input);
    }
コード例 #5
0
    private static IRunnerUserInput GetGpioInput()
    {
        IDigitalInterrupt start = Signals.DigitalInterrupt.Bind((Pin)SecretLabsPinAssignment.GPIO_PIN_D0,
                                                                "Start Tests",
                                                                ResistorMode.PullUp,
                                                                InterruptMode.InterruptEdgeLow,
                                                                50);
        IDigitalInterrupt up = Signals.DigitalInterrupt.Bind((Pin)SecretLabsPinAssignment.GPIO_PIN_D1,
                                                             "Start Tests",
                                                             ResistorMode.PullUp,
                                                             InterruptMode.InterruptEdgeLow,
                                                             50);
        IDigitalInterrupt down = Signals.DigitalInterrupt.Bind((Pin)SecretLabsPinAssignment.GPIO_PIN_D2,
                                                               "Start Tests",
                                                               ResistorMode.PullUp,
                                                               InterruptMode.InterruptEdgeLow,
                                                               50);

        return(new GpioInput(start, up, down));
    }
コード例 #6
0
 public GpioInput(IDigitalInterrupt startTests, IDigitalInterrupt scrollUp = null, IDigitalInterrupt scrollDown = null)
 {
     StartTests = startTests;
     ScrollUp   = scrollUp;
     ScrollDown = scrollDown;
 }