Exemple #1
0
void buttonScript(int target, int val, uint8_t x, uint8_t y){
    char cSREG = SREG; //Store SREG
    uint8_t msg[1];
    if (val) {
        msg[0] = x; // turn top LED on
    } else {
        msg[0] = y; // turn top LED off
    }
    sendCANmsg(target, MSG_demoMsg, msg, 1);
    SREG = cSREG;
}
Exemple #2
0
void buttonScript(int target, int val, uint8_t x){
char cSREG = SREG; //Store SREG
    uint8_t msg[1];
    if (val) {
        msg[0] = x; // turn top LED on
        sendCANmsg(target, MSG_demoMsg, msg, 1);
    }
/*    else{
        msg[0] = 0x00;
    }*/
SREG = cSREG;
}