Giter Site home page Giter Site logo

zl05101 / pxt-iot-environment-kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tinkertanker/pxt-iot-environment-kit

0.0 0.0 0.0 1.37 MB

Environment and Science IoT Kit for micro:bit

License: MIT License

Makefile 0.29% TypeScript 79.23% C++ 20.48%

pxt-iot-environment-kit's Introduction

environment

Environment and Science IoT package is developed under the cooperation of ELECFREAKS, CLASSROOM and TINKERCADEMY.

The ELECFREAKS Environment and Science IoT Kit can detect all kinds of environment data like temperature, humidity, wind speed, light intensity, noise, dust, and PM2.5 level. In addition, you can upload these environment data to the Thingspeak IoT server (free registration required), using the ESP8266 serial wifi module.

Hardware list

  1. ELECFREAKS Octopus:bit.
  2. IIC OLED display
  3. Sound Sensor
  4. Octopus Temperature And Humidity Sensor
  5. Octopus Soil Moisture Sensor
  6. Octopus Analog Photocell
  7. Dust Sensor
  8. PM2.5/PM10
  9. Win Sensor
  10. ESP8266 Serial Wifi Module

Basic usage

  1. Open Microsoft Makecode/microbit and create a new project
  2. Search and add the environment package
  3. Use the Environment_IoT drawer in the editor to drag out and arrange the blocks
  4. Click Download to move your program to the micro:bit

Example

dust sensor init

Initialize dust sensor. Set pin vLED and VO.

Environment_IoT.initdust(DigitalPin.P10, AnalogPin.P1)

read dust

get dust(μg/m³)

Environment_IoT.initdust(DigitalPin.P10, AnalogPin.P1)
basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadDust())
})

read temperature

get DHT11 Temperature(℃)

basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadTemperature(AnalogPin.P0))
})

read PM2.5

get pm2.5(μg/m³)

basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadPM25(DigitalPin.P11))
})

read PM10

get pm10(μg/m³)

basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadPM10(DigitalPin.P12))
})

read soil moisture

get soil moisture, Value Range: 0~100.

basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadSoilHumidity(AnalogPin.P3))
})

read wind speed

get wind speed(m/s)

basic.forever(() => {
    basic.showNumber(Environment_IoT.ReadWindSpeed(AnalogPin.P4))
})

License

MIT

Supported targets

  • for PXT/microbit (The metadata above is needed for package search.)
environment=github:sunnyrainwss/pxt-iot-environment-kit
iot=github:sunnyrainwss/pxt-iot-environment-kit

pxt-iot-environment-kit's People

Contributors

elecfreaks1 avatar firemansamm avatar jeanmah avatar lionyhw avatar riknoll avatar sunnyrainwss avatar yjsoon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.