//#define DHTPIN 3 // By default the module connected to pin D3, it can be changed, define it before the #include of the library
#include "Arduino_SensorKit.h"
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1351.h>
#include <SPI.h>
// Color definitions
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
int light_sensor = A3;
void setup() {
Serial.begin(9600);
Environment.begin();
//.clearDisplay();
Oled.begin();
Oled.setFlipMode(true); // Sets the rotation of the screen
}
void loop() {
Serial.print("Temperature = "); //println put enter at the end of this line?! strange
Serial.print(Environment.readTemperature()); //print temperature
Serial.println(" C");
Serial.print("Humidity = ");
Serial.print(Environment.readHumidity()); //print humidity
Serial.println(" %");
//delay(5000);
int raw_light = analogRead(light_sensor); // read the raw value from light_sensor pin (A3)
Serial.print("Light level: ");
Serial.print(raw_light); // print the light value in Serial Monitor
Serial.println(" lux");
Serial.println("-------------");
Oled.setFont(u8x8_font_chroma48medium8_r);
Oled.setCursor(0, 0); // Set the Coordinates
Oled.print("Temp: ");
Oled.print(Environment.readTemperature()); // Print the Values
Oled.println(" C");
Oled.setCursor(0, 15); // Set the Coordinates
Oled.print("Hum: ");
Oled.print(Environment.readHumidity()); // Print the Values
Oled.println(" %");
Oled.setCursor(0, 30); // Set the Coordinates
Oled.print("Light: ");
Oled.print(raw_light); // Print the Values
Oled.println(" lux");
Oled.refreshDisplay(); // Update the Display
delay(2000);
//Oled.clearDisplay();
}
try that.