User Manual
void setup()
{
Serial.begin(115200);
// wait for serial port to connect. Needed for native USB port only
while (!Serial) delay(1);
Serial.println("Twitter Send Tweet Example\r\n");
// Print all software versions
Feather.printVersions();
while ( !connectAP() )
{
delay(500); // delay between each attempt
}
// Connected: Print network info
Feather.printNetwork();
Twitter.begin(CONSUMER_KEY, CONSUMER_SECRET, TOKEN_ACCESS, TOKEN_SECRET);
Twitter.err_actions(true, true);
Serial.print("Sending tweet: " TWEET " ... ");
Twitter.tweet(TWEET);
Serial.println("OK");
Twitter.stop();
}
/**************************************************************************/
/*!
@brief The loop function runs over and over again forever
*/
/**************************************************************************/
void loop()
{
togglePin(PA15);
delay(1000);
}
/**************************************************************************/
/*!
@brief Connect to defined Access Point
*/
/**************************************************************************/
bool connectAP(void)
{
// Attempt to connect to an AP
Serial.print("Please wait while connecting to: '" WLAN_SSID "' ... ");
if ( Feather.connect(WLAN_SSID, WLAN_PASS) )
{
Serial.println("Connected!");
}
else
{
Serial.printf("Failed! %s (%d)", Feather.errstr(), Feather.errno());
Serial.println();
}
© Adafruit Industries https://learn.adafruit.com/introducing-the-adafruit-wiced-feather-wifi Page 148 of 202










