Serial Monitor

Hi all.

I have just spent 2 days getting my new I Mac desktop to see my UNO R3 board, my new pc can now download to my UNO.
I am training to set up a new BME 280, pressure, temperature and humidity sensor. The problem I have now is I cannot see any data in the Serial Monitor page, while using a test sketch, I sometimes get "BME TEST" but that's all, as I am new to I Mac I thought I would see if anyone can see if I am doing something silly ?This is the sketch I have been using -

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme;

void setup() {
  Serial.begin(9600);

  if (!bme.begin(0x76)) {
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
    while (1);
  }
}

void loop() {
  Serial.print("Temperature = ");
  Serial.print(bme.readTemperature());
  Serial.println("*C");

  Serial.print("Pressure = ");
  Serial.print(bme.readPressure() / 100.0F);
  Serial.println("hPa");

  Serial.print("Approx. Altitude = ");
  Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
  Serial.println("m");

  Serial.print("Humidity = ");
  Serial.print(bme.readHumidity());
  Serial.println("%");

  Serial.println();
  delay(1000);
}

I don't see the word 'test' in your code anywhere and I doubt that Adafruit is printing anything to the monitor so I don't think that sketch actually got loaded.

Try something simpler to prove it - just print "Hello" for example, without all the BME libraries.

it's often useful to print a unique string, such as a date (e.g. 210409a) to verify which code is loaded and running, to remove any doubt.

Try adding this at the top of your setup (I add it to all my sketches)

void setup() {
  Serial.begin(9600);
  for (int i = 10; i > 0; i--) {
    Serial.print(' '); Serial.print(i);
    delay(500);
  }
  Serial.println();
// . . . 
}

and see if you get the 10 9 8 .. printed out.
Adjust the IDE baud rate to 9600.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.