Approved content
The content below is provided by a partner.
A PXT library for Smarthon Smart City IoT Starter kit
Smarthon Smart City IoT Starter kit is designed to introduce Internet of things (IoT). With basic knowledge of computing knowledge and electronics provided in the kit, you can be a city creator and build a unique IoT system in the city. Based on Smarthon IoT board, which is compatible with multiple sensors and actuators, you can design city features; for example: using sensors to detect traffic status and upload city information to the internet.
More product information at https://www.smarthon.cc/micro-bit-smart-city-kit
The light sensor will return the value of luminance in environment
Maxmium:100basic.showNumber(SmartCity.read_light_sensor(AnalogPin.P0))
The Raindrop sensor will return the water amount on the plane to detect the raindrop
Maxmium:100basic.showNumber(SmartCity.read_raindrop_sensor(AnalogPin.P0))
Theh Noise sensor will return the Noise level from the environment
Maxmium:100basic.showNumber(SmartCity.read_sound_sensor(AnalogPin.P0))
The DHT11 sensor will return the temperature and humidity in environment
For Temperaturebasic.showNumber(SmartCity.readData(SmartCity.DHT11dataType.temperature, DigitalPin.P0))
The Distance sensor will return the distance between sensor and object
Maxmium:4M
Minmium:3cm
basic.showNumber(SmartCity.read_distance_sensor(SmartCity.DistanceUnit.Centimeters, DigitalPin.P14, DigitalPin.P15))
The motion sensor will return the motion changing at the front
if (SmartCity.read_motion_sensor(AnalogPin.P0)) {
basic.showIcon(IconNames.Heart)
} else {
basic.showIcon(IconNames.Sad)
}
The traffic light have three led, you may control the led on/off seperartly.
In example,
turn on three led and wait for 1s, then turn off the leds.
SmartCity.control_traffic_light(
true,
true,
true,
AnalogPin.P0
)
basic.pause(1000)
SmartCity.control_traffic_light(
false,
false,
false,
AnalogPin.P0
)
You can control the on/off of led, or adjust to specific brightness.
SmartCity.turn_white_led(0, AnalogPin.P0)
You can control the servo rotate to specific degree
SmartCity.turn_servo(0, AnalogPin.P0)
MIT
(The metadata above is needed for package search.)
smarthon-smartcity-kit=github:SMARTHON/pxt-smartcity#v0.1.49