Git Product home page Git Product logo

esplorascratch's Introduction

EsploraScratch

Fork of the ScratchSensors library for use in a HackerSpace Curriculum.

Core Curriculum combines Scratch, ScratchSensor Library, Arduino IDE and the Arduino Esplora as a Gamepad/Input device.

Initial added files are derived from http://community.computingatschool.org.uk/resources.1225

ScratchSensors

Written by and Copyright Kevin Osborn 2012 Distributed under BSD license. See license.txt for more information All text above must be included in any redistribution.

More info at http://baldwisdom.com

Arduino Library for Scratch Sensor Board (picoboard) emulation

Unzip the contents of this repository into a directory called ScratchSensors in the Arduino libraries directory (or in Sketchbook/libraries)

In your sketch: #include <ScratchSensors.h>

and then: ScratchSensors Scratchboard;

In Setup: Scratchboard.init();

Sensor values are stored in an array internally to the ScratchSensors class called Values[];

The picoboard/Scratch sensor board that is emulated has specific sensor labels that are reported: #define RESISTA 0 #define RESISTB 1 #define RESISTC 2 #define RESISTD 3 #define SLIDER 4 #define LIGHT 5 #define SOUND 6 #define BUTTON 7

Values should be between 0 and 1023. These are scaled by scratch to be between 0 and 100.

BUTTON is handled in a special way: 0 is depressed and 1023 is not pressed.

Let's say you have an analog sensor like an accelerometer connected to Arduino pins A0, A1, and A2.

Then during loop(): Values[RESISTA] = analogRead(A0); Values[RESISTB] = analogRead(A1); Values[RESISTC] = analogRead(A2);

then, write the packets out to the serial/usb port: Scratchboard.report();

There's an example in the examples directory based on the Sparkfun midi shield. It has two pots and three buttons. Of course only one of the buttons can be used with the Scratch buttonpressed semantics, but the others can be tested for specific values.

esplorascratch's People

Contributors

osbock avatar cribstone avatar

Stargazers

 avatar

Watchers

Kevin Curry avatar James Cloos avatar Chris Bond avatar Cristos L-C avatar Mike Hancock avatar Em Burnett 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.