Beispiel #1
0
        private async Task Init()
        {
            expander = new Mcp23017();
            await expander.InitMCP23017Async();

            expander.EnableInterrupts(7);
            expander.EnableInterruptsMirroring();
            expander.pinMode(7, Mcp23017.Direction.INPUT);
            expander.pinMode(8, Mcp23017.Direction.OUTPUT);
            expander.pinMode(9, Mcp23017.Direction.OUTPUT);
            expander.pinMode(10, Mcp23017.Direction.OUTPUT);
            MoveLed();
        }
Beispiel #2
0
        internal async Task InitChips()
        {
            p  = new Mcp23017(0x20);
            p1 = new Mcp23017(0x21);
            p2 = new Mcp23017(0x22);

            await p.InitMCP23017Async();

            await p1.InitMCP23017Async();

            await p2.InitMCP23017Async();

            for (int i = 0; i < 16; i++)
            {
                p.pinMode(i, Mcp23017.Direction.OUTPUT);
                p1.pinMode(i, Mcp23017.Direction.OUTPUT);
                p2.pinMode(i, Mcp23017.Direction.OUTPUT);
            }
        }