Our goal


Required materials


Background


What is the environmental monitoring

Hardware connection


As below picture, let the light sensor be connected to P1.

Let the BME280 module be connected to SCL-P19 SDA-P20 of the IIC.

Let the onboard RTC be connected to IIC.

Software


makecode

Coding


Step 1

Note:If you get a warning telling you some packages will be removed because of incompatibility issues, either follow the prompts or create a new project in the Project file menu.

Step 2

Snap the initialize OLED in to the on start, initialize OLED screen pixels to 64*128.

Step 2

Snap the show string and show number blocks into the forever in turn.

Display current light intensity, humidity and temperature.

Then, snap into the insert newline.

Program

Program link:https://makecode.microbit.org/_gXa1mXargW1V

If you don’t want to type these code by yourself, you can directly download the whole program from the link below:

Result


The light intensity, temperature and humidity be displayed every minute.

Think


How do you count the data in a day ?

Questions


More Information