Buongiorno,volevo un aiuto per lo sketch sotto postato ,in cui non riesco ad includere :adafruit feather .h;adafruit aio.h.Avendo un po' di eta' alle spalle mi rende difficile tale operazione.Vi ringrazio:
#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;
}
Ciao, le librerie son inserite bene nel codice quindi presumo che il problema è altro.
Quando compili ti da qualche messaggio di errore? Hai inserito bene le librerie nell'IDE,sono presenti nella cartella delle librerie?
ecco quello che esce sotto la cartelle dell'ide : fatal error:adafruit_feather.h no such file or directory;
include <adafruit_feather.h>.Piu' di una libreria trovata per Adafruit _GFX.h,non usata adafruit_GFX master.Piu' di una libreria trovata per Adafruit_SSD1306.h e non usata libraries Adafruit_SSD 1306 master.Errore durante la compilazione scheda adafruit huzzah esp 8266.
Come ti avvisa il compilatore, una libreria manca, adafruit_feather.h
Ma poi hai anche delle librerie doppie. Come le installi ? Quale versione di IDE usi ?
la versione dell'Ide e' 1.8.5 .Che le librerie siano doppie non le ho incluse io.Ma il problema e' come trovare la libreria Adafruit_feather.h e' includerla.Questo e' quello che ho chiesto
Hai seguito alla lettera i due relativi tutorials (che parlano anche esattamente di cosa occorre fare con l'IDE di Arduino e di cosa occorre installare) ?
display.println("Sending val #0");
display.setCursor(0,0);
display.display(); // actually display all of the above
}
void loop() {
if (! digitalRead(BUTTON_A)) display.print("A");
if (! digitalRead(BUTTON_B)) display.print("B");
if (! digitalRead(BUTTON_C)) display.print("C");
delay(10);
yield();
display.display();
}
Certo che ho eseguito tutto sui due tutorials e quello che bisogna fare
Non mi pare..... questa parte l'hai saltata
FeatherOLED Library
by Kevin Townsend
To make it easier to work with the OLED FeatherWing with specific Feather boards we've published an optional BETA library called Adafruit_FeatherOLED.
>federico1: ti ricordo che in conformità al regolamento, punto 7, devi editare il tuo post#11 (quindi NON scrivendo un nuovo post, ma utilizzando il bottone More -> Modify che si trova in basso a destra del tuo post) e racchiudere il codice all'interno dei tag CODE (... sono quelli che in edit inserisce il bottone con icona fatta così: </>, tutto a sinistra).