Giter Club home page Giter Club logo

microbit-sillio's Introduction

SillIO

A really silly way to send data from micro:bit to your laptop using the micro:bit display and laptop webcam.

...why?

I got a microbit a couple of days ago. It's pretty awesome but I couldn't figure out how to get it to interact with python code on my laptop. So I wrote some code which can use my laptop webcam to recognise my lovely micro:bit and tell me which LEDs are on and off.

You realise there are better ways to do this?

You mean like this? I guess it's fun to try something different (even if it's a silly idea).

So how does this work?

Well... you flash the micro:bits with some python which lights up a ring of LEDs around the edge of the display - that makes a pattern which is easy to find. One light is kept off so the computer can tell which way round it is.

Then you run a python script on your laptop, which creates a website you can open in your web browser. The website uses JavaScript to turn on your webcam and find bright lights in the video. By looking for lines of bright lights, you can find the micro:bit display.

When you press Button A, it turns on more LEDs which tells the computer to start drawing a line. When you press Button B, it turns on an LED which tells the computer to delete the line. The terminal tells you which lights are on and which buttons are pressed.

Did it work?

Sort of. It's not bad for about 2 hours of coding around PyCon but it could be a lot better. You can watch a demo on youtube.

SillIO

I reckon I could do that much better

Yeah, so do I. You can use my code if you like - just clone, fork or download. If you make something cool let me know, or make a pull request. Or send me ideas through the issue tracker. I might take a while to respond but I'll get back to you eventually!

How can I run this

There are very few comments and no documentation. Sorry about that. To run it, you'll need to:

  1. Download this repository
  2. Flash the marker.py file onto your micro:bit
  3. Install python3 and pip if you don't already have them
  4. Install pipenv using pip (pip install pipenv)
  5. Install dependencies in a virtual environment (pipenv shell)
  6. Run the server (python pyserv.py)
  7. Go to localhost:8888 and see what happens.

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.