Example #1
0
void UploadResults() {
    leds[0] = CRGB::Yellow;
    FastLED.show();

    uint16_t returncode;
    TurnOnFona();
    delay(1000);
    myfona.begin(4800);
    fona.begin(myfona);
    delay(3500);
    GetConnected();
    delay(3000);
    fona.enableGPRS(true);
    delay(3000);

    char url[200];
    uint16_t statuscode;
    int16_t length;
    sprintf(url, "%s%s%s%s", "http://api.ubirch.com/rp15/push?id=", userid, "&erg=", results);
    flushSerial();
    if (!fona.HTTP_GET_start(url, &statuscode, (uint16_t *) &length)) {
        Serial.println(F("Get Failed!"));
    }
    fona.HTTP_GET_end();


    delay(100);
    GetDisconnected();
    delay(1000);
    TurnOffFona();
    leds[0] = CRGB::Black;
    FastLED.show();
}
Example #2
0
/*
* Initial module setup.
* Starts the module after setup is complete.
*/
void BLEModule::initialSetup()
{
  //Full initialisation of the module from scratch.
  if(firstTimeSetup)
  {
    sendSerial(SET_ROLE_SLAVE);
    delay(300);
    sendSerial(SET_MODULE_NAME_SQUASHT);
    delay(300);
    sendSerial(RESET_MODULE);
    delay(500);
  }

  //Start the module.
  sendSerial(START_MODULE);
  delay(500);

  flushSerial(); //Needed to clear out any leftover responses.
  setupMode=false;
} 
Example #3
0
Nextion::Nextion(HardwareSerial &next, uint32_t baud): nextion(&next){
  nextion->begin(baud);
  flushSerial();
}