Datasheet
// Refresh the screen
oled.refreshIcons();
oled.clearMsgArea();
// Try to connect to the AP
if ( !connectAP() )
{
// Enter a while(1) loop here since any connection error
// is handled in .connectAP() above
while(1);
}
#if AIO_ENABLED
// Attempt to connect to a Broker
oled.clearMsgArea();
oled.println("io.adafruit.com");
oled.display();
// Connect to AIO server
if ( aio.connect() )
{
oled.println("Connected!");
oled.display();
}else
{
oled.print("Failed! Error: ");
oled.println(aio.errno(), HEX);
oled.display();
delay(3000);
}
// Follow feed if enabled
if ( VBAT_ENABLED )
feedVBAT.follow(aio_vbat_callback);
// Follow feed if enabled
if ( SENSOR_TSL2561_ENABLED )
feedLUX.follow(aio_vbat_callback);
#endif
}
/**************************************************************************/
/*!
@brief This loop function runs over and over again
*/
/**************************************************************************/
void loop()
{
// Update the battery level
if ( VBAT_ENABLED )
© Adafruit Industries https://learn.adafruit.com/adafruit-oled-featherwing Page 28 of 32










