Пример #1
0
void setup() {
    // Initialize D0 + D7 pin as output
    // It's important you do this here, inside the setup() function rather than outside it or in the loop function.
    pinMode(D2, OUTPUT);
    digitalWrite(D2, LOW);
    delay(50);
    digitalWrite(D2, HIGH); //Reset both MCPS
  //  delay(50);
    
    clocks.begin();
    power.begin(1);
    clocks.pinMode(0,OUTPUT);
    power.pinMode(0,OUTPUT);
    clocks.digitalWrite(0,HIGH);
    power.digitalWrite(0,HIGH);// Register macros
    // Register macros
    cleg.registerMacro("high", "1");
    cleg.registerMacro("low", "0");
    // Register custom functions with the engine
    cleg.registerFunction("echo", CommandFunction_echo);
    cleg.registerFunction("information", CommandFunction_information);
    cleg.registerFunction("McpReg", CommandFunction_PrintMCP);

    tServer.setProcessCallback(processData);

    tServer.connect();
}
Пример #2
0
void
setup(void)
{
    mcp.begin();
    mcp.set_pin_mode(OUTPUT);
}