Schokolino
Member
Hi,
iam using the standard BMP280 test library from adafruit. And there is a problem because the Teeny is not printing anything in the console. Do you have any ideas what the issue could be?
Best regards
Leon
iam using the standard BMP280 test library from adafruit. And there is a problem because the Teeny is not printing anything in the console. Do you have any ideas what the issue could be?
Best regards
Leon
HTML:
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_BMP280.h>
#include <Servo.h>
#define BMP_SCK (13)
#define BMP_MISO (12)
#define BMP_MOSI (11)
#define BMP_CS (10)
int ground = 0;
int aktuell = 0;
int maxwert = 0;
Servo servo;
//Adafruit_BMP280 bmp; // I2C
Adafruit_BMP280 bmp(BMP_CS); // hardware SPI
Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);
void setup() {
Serial.begin(9600);
Serial.print("Hello");
servo.attach(3);
servo.write(90);
Serial.println(F("BMP280 test"));
servo.write(70);
if (!bmp.begin()) {
Serial.println(F("Could not find a valid BMP280 sensor, check wiring!"));
while (1);
}
/* Default settings from datasheet. */
bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, /* Operating Mode. */
Adafruit_BMP280::SAMPLING_X2, /* Temp. oversampling */
Adafruit_BMP280::SAMPLING_X16, /* Pressure oversampling */
Adafruit_BMP280::FILTER_X16, /* Filtering. */
Adafruit_BMP280::STANDBY_MS_500); /* Standby time. */
ground = bmp.readAltitude();
maxwert = ground;
aktuell = ground;
servo.write(90);
}
void loop() {
// Serial.print(F("Temperature = "));
//Serial.print(bmp.readTemperature());
//Serial.println(" *C");
Serial.print(F("Pressure = "));
Serial.print(bmp.readPressure() / 100);
Serial.println(" hPa");
Serial.print(F("Approx altitude = "));
Serial.print(bmp.readAltitude(1013.25)); /* Adjusted to local forecast! */
Serial.println(" m");
}