Coder Social home page Coder Social logo

pxt-mm-sensor's Introduction

PTX (Makecode) Blocks for the MonkMakes Sensor for micro:bit board.

Installation

From your Blocks code editor, click Advanced and then Extensions. Next, enter the url:

https://github.com/monkmakes/pxt-mm-sensor.git

into the search field at the top of the screen.

// fig showing search results

Once the extension is added, you will find a new blocks category called Sensor

Sensor blocks category

Examples

First wire up your Sensor to your micro:bit like this.

Sensor blocks category

Detecting Claps

The sound level block returns a value between 0 and 100 depending on the overall level of sound that the microphone on the sensor is hearing.

This example reads the sound level and if it is above 20, it displays the YES image on the micro:bit's display for half a second. Try standing a few feet away from the sensor and clapping.

Clap Detector

Here's a link to the Makecode project: https://makecode.microbit.org/_WpsR1T5XpfE2

Thermometer

The temp c block returns the temperature measured by the board's thermistor in degrees Celcius. There is also a Fahrenheit version of the block.

This example will display the temperature every half second. Try putting your finger on the temperature sensor part of the Sensor board to warm it up.

Thermometer

Here's a link to the Makecode project: https://makecode.microbit.org/_c5qhvjTaR1u1

Light Meter

The light level block also returns a reading between 0 and 100. This example is very like the thermometer example, displaying the light level every half a second.

Thermometer

Shade the light sensor with your hand and the readings should decrease.

Here's a link to the Makecode project: https://makecode.microbit.org/_YUfPH3E7qbVc

TODO

  • [ x] Add a reference for your blocks here
  • [ x] Add "icon.png" image (300x200) in the root folder
  • [ x] Add "- beta" to the GitHub project description if you are still iterating it.
  • Turn on your automated build on https://travis-ci.org
  • Use "pxt bump" to create a tagged release on GitHub
  • Get your package reviewed and approved https://makecode.microbit.org/packages/approval

Read more at https://makecode.microbit.org/packages/build-your-own

License

Supported targets

  • for PXT/microbit (The metadata above is needed for package search.)

pxt-mm-sensor's People

Contributors

monkmakes avatar

Watchers

Simon Monk 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.