Example Code for MakeCode-Read Temperature & Humidity
This example read and print the temperature and relative humidity from serial every 2s.
Hardware Preparation
- micro:bit - an Educational & Creative Tool for Kids x 1
- Micro:Mate - A Mini Expansion Board for micro:bit x 1
- Gravity: Analog SHT30 Temperature & Humidity Sensor
- Gravity 3P sensor wire (or Dupont wires) x 1
Software Preparation
Wiring Diagram
Sample Code
Result
- Temperature and relative humidity are printed from serial every 2s.
Was this article helpful?
