Datasheet
#include <adafruit_aio.h>
#define WLAN_SSID "SSID"
#define WLAN_PASS "PASSWORD"
#define VBAT_ENABLED 1
#define VBAT_PIN PA1
#define SENSOR_TSL2561_ENABLED 0
#if SENSOR_TSL2561_ENABLED
#include <Adafruit_TSL2561_U.h>
bool _tslFound = false;
Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);
#endif
#define AIO_ENABLED 0
#define AIO_USERNAME "...your AIO username (see https://accounts.adafruit.com)..."
#define AIO_KEY "...your AIO key..."
#define FEED_VBAT "vbat"
#define FEED_TSL2561_LUX "lux"
AdafruitAIO aio(AIO_USERNAME, AIO_KEY);
AdafruitAIOFeedGauge<float> feedVBAT(&aio, FEED_VBAT);
AdafruitAIOFeedGauge<float> feedLUX (&aio, FEED_TSL2561_LUX);
Adafruit_FeatherOLED_WiFi oled = Adafruit_FeatherOLED_WiFi();
/**************************************************************************/
/*!
@brief Connect to the AP
@return Error code
*/
/**************************************************************************/
bool connectAP()
{
oled.refreshIcons();
oled.clearMsgArea();
oled.println("Connecting to ...");
oled.println(WLAN_SSID);
oled.display();
// Attempt to connect to the AP
if ( Feather.connect(WLAN_SSID, WLAN_PASS) )
{
int8_t rssi = Feather.RSSI();
uint32_t ipAddress = Feather.localIP();
oled.setConnected(true);
oled.setRSSI(rssi);
oled.setIPAddress(ipAddress);
oled.refreshIcons();
© Adafruit Industries https://learn.adafruit.com/adafruit-oled-featherwing Page 25 of 32










