Пример #1
0
void
loop(void)
{
    mcp.write(0x0000);
    delay(1000);

    mcp.write(0xFFFF);
    delay(1000);
}
Пример #2
0
void CommandFunction_PrintMCP(Print * printer, CommandEngine::Tokens & tk, CommandEngine::CommandLineEngine::FunctionFlags ff) {
    if (ff == CommandEngine::CommandLineEngine::FF_HelpText) {
        printer->println("Help with Echo command:");
        printer->println("echo [value1] [value2] [value3] [value...]");
        printer->println("[value] = either a macro $ or a literal value");
        printer->println("Mostly for debugging the engine.");
        return;
    }
    for(int i = 0;i < 0x15;i++){
        printer->print("Clocks Reg ");
        printer->print(i);
        printer->print(" ");
        printer->println(clocks.readRegister(i));
        printer->print("Power Reg ");
        printer->print(i);
        printer->print(" ");
        printer->println(power.readRegister(i));
    }
}
Пример #3
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();
}
Пример #4
0
void
setup(void)
{
    mcp.begin();
    mcp.set_pin_mode(OUTPUT);
}