Approved content
The content below is provided by a partner.
A MakeCode extension for Smarthon Smart Home IoT Maker kit
Smarthon Smart Home IoT Maker Kit for micro:bit is designed to introduce smart home concept implementation of Internet of Things (IoT) into daily life. Derived from Smarthon IoT board, you can express your creativity on building a smart house for living using in up to 13 cases from simple to IoT level, including smart saving light bulb, and home health data monitoring system in different areas like living room, bedroom, kitchen, toilet, door area etc. The provided full flexible model allows the user to create different styles of the house and add the decoration to the model easily.
You may check the product information by https://en.smarthon.cc/micro-bit-smart-home-kitYou may check the Read the Docs about Smarthon IoT:bit here:https://smarthon-docs-en.readthedocs.io/en/latest/IoTbit/index.html
The light sensor will return the percentage value of luminance in environment
Maxmium:100basic.showNumber(House.getLight(AnalogPin.P0))
The Distance sensor will return the distance between sensor and object
Maxmium:4Mbasic.showNumber(House.read_distance_sensor(House.DistanceUnit.Centimeters, DigitalPin.P14, DigitalPin.P15))
The flame sensor will return the detection of fire result
Detected:TRUEif (House.getFlame(DigitalPin.P0)) {
basic.showString("Detected!")
}
The motion sensor will return the motion changing at the front
Detected change:TRUE
Not Detected change:FALSE
if (House.read_motion_sensor(DigitalPin.P0)) {
basic.showString("Detected!")
}
The function in the block will be execute after the button (connected to pin) pressed
House.Button(House.PressButtonList.b0, function () {
basic.showString("Pressed!")
})
The DHT11 sensor will return the temperature and humidity in environment, and save in the variable
Before showing or using the variable, need to be read the DHT11 sensor For TemperatureHouse.readDHT11(DigitalPin.P0)
basic.showNumber(House.readTemperatureData(House.Temp_degree.degree_Celsius))
basic.showNumber(House.readHumidityData())
Base on the temperature and humidity, the IAQ score will repersent the comfortability of environment
Before geting the IAQ score, need to be read the DHT11 sensorHouse.readDHT11(DigitalPin.P0)
basic.showNumber(House.getIAQ())
Input the value to let the motor fan work in different speed
Maxmium:1023input.onButtonPressed(Button.A, function () {
House.TurnMotor(1023, AnalogPin.P1)
})
Input the value to let the 180 degree servo motor move to specific position
Maxmium:180input.onButtonPressed(Button.A, function () {
House.Turn180Servo(180, AnalogPin.P0)
})
Choose the direction and speed to let the 360 degree servo motor to moving in specific way and speed
For directioninput.onButtonPressed(Button.A, function () {
House.Turn360Servo(House.ServoDirection.clockwise, House.ServoSpeed.level3, AnalogPin.P0)
})
MIT
(The metadata above is needed for package search.)
smarthon-smarthome-kit=github:SMARTHON/pxt-smarthome#v1.8.5