- Codice: Seleziona tutto
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_FeatherOLED.h>
#include <Adafruit_FeatherOLED_WiFi.h>
#include <Adafruit_Sensor.h>
#include <adafruit_feather.h>
#include <adafruit_mqtt.h>
#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();
oled.clearMsgArea();
}
else
{
// Display the error message
err_t err = Feather.errno();
oled.setConnected(false);
oled.refreshIcons();
oled.clearMsgArea();
oled.println("Connection Error:");
switch (err)
{
case ERROR_WWD_ACCESS_POINT_NOT_FOUND:
// SSID wasn't found when scanning for APs
oled.println("Invalid SSID");
break;
case ERROR_WWD_INVALID_KEY:
// Invalid SSID passkey
oled.println("Invalid Password");
break;
default:
// The most likely cause of errors at this point is that
// you are just out of the device/AP operating range
oled.print(Feather.errno());
oled.print(":");
oled.println(Feather.errstr());
oled.refreshIcons(); // Refresh icons in case the text ran over
break;
}
oled.display();
// Return false to indicate that we received an error (available in feather.errno)
return false;
}
return true;
}
Problema su librerie
5 messaggi
• Pagina 1 di 1
0
voti
Ho un problema sulle librerie sullo sketch sotto postato che non riesco a trovare ed installarle:le librerie sono Adafruit_feather.h e adafruit_aio.h
Ultima modifica di
wall87 il 25 set 2017, 16:59, modificato 1 volta in totale.
Motivazione: Titolo in minuscolo
Motivazione: Titolo in minuscolo
0
voti
probabilmente non le hai incluse nel progetto
MCSA Windows Server 2012 R2
Cisco CCNA R&S - Cisco CCNA Security - Cisco CCNA Cyber Ops
CompTia A+ - CompTia Linux+ - CompTIA Systems Support Specialist CSSS
CompTia Pentest+ LPIC-1 - VCP VMware - Cisco CCNP Enterprise
Cisco CCNA R&S - Cisco CCNA Security - Cisco CCNA Cyber Ops
CompTia A+ - CompTia Linux+ - CompTIA Systems Support Specialist CSSS
CompTia Pentest+ LPIC-1 - VCP VMware - Cisco CCNP Enterprise
0
voti
Ciao,
hai seguito la guida fornita su Adafruit per aggiungere il supporto a board di terze parti sull'IDE Arduino?
Seguendo le istruzioni in questo tutorial (sono tre paginette) dovresti risolvere
https://learn.adafruit.com/add-boards-a ... 4/overview
hai seguito la guida fornita su Adafruit per aggiungere il supporto a board di terze parti sull'IDE Arduino?
Seguendo le istruzioni in questo tutorial (sono tre paginette) dovresti risolvere
https://learn.adafruit.com/add-boards-a ... 4/overview
5 messaggi
• Pagina 1 di 1
Chi c’è in linea
Visitano il forum: Nessuno e 1 ospite

Elettrotecnica e non solo (admin)
Un gatto tra gli elettroni (IsidoroKZ)
Esperienza e simulazioni (g.schgor)
Moleskine di un idraulico (RenzoDF)
Il Blog di ElectroYou (webmaster)
Idee microcontrollate (TardoFreak)
PICcoli grandi PICMicro (Paolino)
Il blog elettrico di carloc (carloc)
DirtEYblooog (dirtydeeds)
Di tutto... un po' (jordan20)
AK47 (lillo)
Esperienze elettroniche (marco438)
Telecomunicazioni musicali (clavicordo)
Automazione ed Elettronica (gustavo)
Direttive per la sicurezza (ErnestoCappelletti)
EYnfo dall'Alaska (mir)
Apriamo il quadro! (attilio)
H7-25 (asdf)
Passione Elettrica (massimob)
Elettroni a spasso (guidob)
Bloguerra (guerra)


