Many thanks but the example doesn’t fit with my my code.
I totally cancelled the part regarding the display of data on the oled, But the is different, is this:
Arduino:1.6.5 (Windows XP), Scheda:"WeMos D1 R2 & mini, 80 MHz, 921600, 4M (3M SPIFFS)"
Opzioni di compilazione cambiate, ricompilo tutto
Uso la libreria Wire nella cartella: C:\Documents and Settings\mio\Documenti\Arduino\libraries\Wire (legacy)
Uso la libreria SFE_BMP180-master nella cartella: C:\Documents and Settings\mio\Documenti\Arduino\libraries\SFE_BMP180-master (legacy)
Uso la libreria SPI nella cartella: C:\Documents and Settings\mio\Documenti\Arduino\libraries\SPI-master
C:\Documents and Settings\mio\Dati applicazioni\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -IC:\Documents and Settings\mio\Dati applicazioni\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include -IC:\Documents and Settings\mio\Dati applicazioni\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include -IC:\DOCUME~1\mio\IMPOST~1\Temp\build4264022526565155186.tmp/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DLWIP_OPEN_SRC -DARDUINO=10605 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_WEMOS_D1MINI" -DESP8266 -IC:\Documents and Settings\mio\Dati applicazioni\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266 -IC:\Documents and Settings\mio\Dati applicazioni\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\variants\d1_mini -IC:\Documents and Settings\mio\Documenti\Arduino\libraries\Wire -IC:\Documents and Settings\mio\Documenti\Arduino\libraries\SFE_BMP180-master -IC:\Documents and Settings\mio\Documenti\Arduino\libraries\SPI-master C:\DOCUME~1\mio\IMPOST~1\Temp\build4264022526565155186.tmp\meteo_SFE_BMP180_without_display.cpp -o C:\DOCUME~1\mio\IMPOST~1\Temp\build4264022526565155186.tmp\meteo_SFE_BMP180_without_display.cpp.o
In file included from meteo_SFE_BMP180_without_display.ino:35:0:
C:\Documents and Settings\mio\Documenti\Arduino\libraries\SPI-master/SPI.h:1028:8: error: 'SPIClass' does not name a type
extern SPIClass SPI;
^
Multiple libraries were found for "Wire.h"
Used: C:\Documents and Settings\mio\Documenti\Arduino\libraries\Wire
Not used: C:\Documents and Settings\mio\Dati applicazioni\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\Wire
Multiple libraries were found for "SFE_BMP180.h"
Used: C:\Documents and Settings\mio\Documenti\Arduino\libraries\SFE_BMP180-master
Not used: C:\Documents and Settings\mio\Documenti\Arduino\libraries\BMP180_ILI9163_SPI_TFT_Example
Not used: C:\Documents and Settings\mio\Documenti\Arduino\libraries\BMP180_Breakout_Arduino_Library-master
Multiple libraries were found for "SPI.h"
Used: C:\Documents and Settings\mio\Documenti\Arduino\libraries\SPI-master
Not used: C:\Documents and Settings\mio\Documenti\Arduino\libraries\SSD1306
Not used: C:\Documents and Settings\mio\Dati applicazioni\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\SPI
Transalation: uso means I use, cartella means directory
Errore durante la compilazione
The complete sketch is this sketch;
/*
***************************
*
*PROGRAMMA IN USO SU DISPLAY
18/9/2017
Inserito programma BMP180_exxample sul quale c?è anche
il calcolo della pressione al livello del mare.
19/9
inserita freccia indicante tendenza pressione
Prossimi sviluppi salvare i dati su scheda SD
TFT Graph
***************************+
This example for an Arduino screen reads
the value of an analog sensor on A0, and
graphs the values on the screen.
This example code is in the public domain.
Created 15 April 2013 by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/TFTGraph
*/
#include <Wire.h>
#include <SFE_BMP180.h>
#include <SPI.h>
int i=1;
// position of the line on screen
int xPos = 0;
float temp;
float patm; //usata per salvare ultima pressione per confronto
// con attuale
//#Store an instance of the BMP180 sensor.
SFE_BMP180 pressure;
// Store the current sea level pressure at your location in Pascals.
float seaLevelPressure = 101620; // Williamsburg, VA on
#define ALTITUDE 84.0 // Altitude of Basaldella-Udine
void setup() {
// initialize the serial port
Serial.begin(9600);
// We start the I2C on the Arduino for communication with the BMP180 sensor.
Wire.begin();
// We create an instance of our BMP180 sensor.
pressure = SFE_BMP180();
if (pressure.begin())
Serial.println("BMP180 init success");
else
{
// Oops, something went wrong, this is usually a connection problem,
// see the comments at the top of this sketch for the proper connections.
Serial.println("BMP180 init fail\n\n");
while(1); // Pause forever.
}
}
void loop()
{
char status;
double T,P,p0,a;
// Loop here getting pressure readings every 10 seconds.
// If you want sea-level-compensated pressure, as used in weather reports,
// you will need to know the altitude at which your measurements are taken.
// We're using a constant called ALTITUDE in this sketch:
// If you want to measure altitude, and not pressure, you will instead need
// to provide a known baseline pressure. This is shown at the end of the sketch.
// You must first get a temperature measurement to perform a pressure reading.
// Start a temperature measurement:
// If request is successful, the number of ms to wait is returned.
// If request is unsuccessful, 0 is returned.
status = pressure.startTemperature();
if (status != 0)
{
// Wait for the measurement to complete:
delay(status);
// Retrieve the completed temperature measurement:
// Note that the measurement is stored in the variable T.
// Function returns 1 if successful, 0 if failure.
status = pressure.getTemperature(T);
if (status != 0)
{
//Cancello lo schermo per T e indico andamento pressione
//confrontanto pressione prima cancellazione con attuale
// Print out the measurement:
Serial.print("temperature: ");
Serial.print(T,2);
Serial.print(" deg C, ");
Serial.print((9.0/5.0)*T+32.0,2);
Serial.println(" deg F");
//Display temperatura
temp=T;
// Start a pressure measurement:
// The parameter is the oversampling setting, from 0 to 3 (highest res, longest wait).
// If request is successful, the number of ms to wait is returned.
// If request is unsuccessful, 0 is returned.
status = pressure.startPressure(3);
if (status != 0)
{
// Wait for the measurement to complete:
delay(status);
// Retrieve the completed pressure measurement:
// Note that the measurement is stored in the variable P.
// Note also that the function requires the previous temperature measurement (T).
// (If temperature is stable, you can do one temperature measurement for a number of pressure measurements.)
// Function returns 1 if successful, 0 if failure.
status = pressure.getPressure(P,T);
if (status != 0)
{
// Print out the measurement:
Serial.print("absolute pressure: ");
Serial.print(P,2);
Serial.print(" mb, ");
Serial.print(P*0.0295333727,2);
Serial.println(" inHg");
// The pressure sensor returns abolute pressure, which varies with altitude.
// To remove the effects of altitude, use the sealevel function and your current altitude.
// This number is commonly used in weather reports.
// Parameters: P = absolute pressure in mb, ALTITUDE = current altitude in m.
// Result: p0 = sea-level compensated pressure in mb
p0 = pressure.sealevel(P,ALTITUDE); // we're at 1655 meters (Boulder, CO)
Serial.print("relative (sea-level) pressure: ");
Serial.print(p0,2);
Serial.print(" mb, ");
Serial.print(p0*0.0295333727,2);
Serial.println(" inHg");
Serial.print("Valore pressione: ");
Serial.println(patm);
// On the other hand, if you want to determine your altitude from the pressure reading,
// use the altitude function along with a baseline pressure (sea-level or other).
// Parameters: P = absolute pressure in mb, p0 = baseline pressure in mb.
// Result: a = altitude in m.
a = pressure.altitude(P,p0);
Serial.print("computed altitude: ");
Serial.print(a,0);
Serial.print(" meters, ");
Serial.print(a*3.28084,0);
Serial.println(" feet");
Serial.print("Posizione:");
Serial.println(xPos);
//Cancello lo schermo sul dato di T
delay(50000); // Pause for 5 seconds.
if (xPos >= 160) {
xPos = 0;
patm=p0;
//TFTscreen.background(255, 255, 255);
}
}
else Serial.println("error retrieving pressure measurement\n");
}
else Serial.println("error starting pressure measurement\n");
}
else Serial.println("error retrieving temperature measurement\n");
}
else Serial.println("error starting temperature measurement\n");
}
You can ignore all comments in italian
Thanks
Renzo