예제 #1
0
// Setup method runs once, when the sketch starts
void setup() {
    // Stop red LED blinking on Electron
    batteryCharger.disableCharging();

	Serial.begin(9600);
    delay(100);
    Serial.println("Logomatic");
    randomSeed(HAL_RNG_GetRandomNumber());

    // FIXME: disable gesture sensor for now
    //gesture.begin();
    setupAnimationContext();
    setupSdCard();

    addStartupAnimations();
}
예제 #2
0
/* This function loops forever --------------------------------------------*/
void loop()
{
    //updatePower();
    
    //Serial1.print("power off returned:");
    //Serial1.println(electronMDM.powerOff());
    //RGB.color(0,0,255);
    //delay(200);
    //RGB.color(0,255,0);
    //delay(200);
    //RGB.color(255,0,0);
    //delay(200);
    //Serial1.println(power.readPowerONRegister(),BIN);
    if (Serial1.available() > 0)
    {
        char inByte = Serial1.read();
        Serial1.print("I rxed this shit:");
        Serial1.println(inByte);
        if (inByte == 'o') {
            Serial1.println("char o received");
            power.enableOTG();
            delay(50);
        }
        if (inByte == 'd') {
            Serial1.println("char d received");
            power.disableCharging();
            delay(50);
        }
        if (inByte == 'e') {
            Serial1.println("char d received");
            power.enableCharging();
            delay(50);
        }
    }
    //System.sleep(SLEEP_MODE_DEEP,60);

}