These are chat archives for SmingHub/Sming

10th
May 2016
alonewolfx2
@alonewolfx2
May 10 2016 12:55
@Sakib5130 you are talking about sming's ftp ?
it has a bug that it solved on smingRTOS version and it will not ported on smingNONOS version.
alon24
@alon24
May 10 2016 14:06
@hreintke I realy cannot make heads or tail from this mcp23017 stuff - it does not work for me, for intrupts and If I do polling i get strange results
    mcp = new MCP23017();

    mcp->begin(0);
    mcp->setupInterrupts(true, false, LOW);
    mcp->pinMode(5, INPUT);
    mcp->pinMode(6, INPUT);
    mcp->pinMode(7, INPUT);
    mcp->pinMode(8, INPUT);
    mcp->pullUp(5, HIGH);
    mcp->pullUp(6, HIGH);
    mcp->pullUp(7, HIGH);
    mcp->pullUp(8, HIGH);
//    mcp->setupInterruptPin(5, CHANGE);
//    mcp->setupInterruptPin(6, CHANGE);
//    mcp->setupInterruptPin(7, CHANGE);

//    pullup(interruptPin);
//    attachInterrupt(interruptPin, interruptCallback, (GPIO_INT_TYPE)3);

    mcpPollTimer.initializeMs(300, TimerDelegate(checkMcpPoll)).start();
}

int prevA = 0;
int prevB = 0;
Timer mcpPollTimer;
void checkMcpPoll() {
    int a = mcp->readGPIO(0);
    int b = mcp->readGPIO(1);
//    if (prevA != a || prevB != b) {
        prevA = a;
        prevB = b;
        debugf("poll status for pin %i=%i,%i", mcpPinA, a,b);
//    }
}
poll status for pin 7=232,1
poll status for pin 7=232,1
poll status for pin 7=232,1
poll status for pin 7=232,1
poll status for pin 7=232,1
poll status for pin 7=232,1
poll status for pin 7=232,1
poll status for pin 7=232,1
poll status for pin 7=232,1
poll status for pin 7=248,1
poll status for pin 7=224,1
poll status for pin 7=224,1
poll status for pin 7=96,1
poll status for pin 7=96,1
poll status for pin 7=96,1
poll status for pin 7=224,1


I cannot corrlate the numbers for a, to pins pressed!
pushing 1 button at a time