littleBits meets Scratch

by abee June 7, 2014
5

Scratch is a visual programming environment from MIT Media Lab.
You can program anything, game, anime, music and etc by building blocks without keyboard.
Scratch also supports PicoBoard and WeDo.
PicoBoard is a sensor board that detects light, sound, button, sliders and resisters, and transforms them into the values of Scratch.
WeDo is a robot kit from LEGO education. It is like Mindstorms but it can be controlled by Scratch.

I wrote a sketch to emulate PicoBoard and WeDo for littleBits Arduino module. So you can play Scratch with all of littleBits modules.
http://squeakland.jp/abee/tmp/NanoBoardAGWithMotors.zip

Bits used: Arduino

Tags: Programming Gadgets Hack

Credits: The Arduino sketch is based on NanoBoard by by Tomo Niimura. And NanoBoard is based on HelloBoardV2 by PINY and Song Hojun. Those sketches are licensed under CC BY-SA. https://creativecommons.org/licenses/by-sa/3.0/ Scratch Source Code is licensed under Scratch Source Code License by MIT. http://wiki.scratch.mit.edu/wiki/Scratch_Source_Code_License NanoBoardAGWithMotor and NanoBoardAGWithMotors are licensed under MIT license by Kazuhiro Abe. http://swikis.ddo.jp/WorldStethoscope/47

Videos and Recipes

Instructions

  1. 1

    If you want to use it as PicoBoard, just upload the sketch, “littleBitsAsScratchSensorBoard.ino” to your Arduino module by Arduino IDE. It works with Scratch 1.4 and 2.0 online extension.

    The value of input port “d0” is reflected in “button” of Scratch.
    The value of input port “a1” is reflected in “slider”.
    The value of input port “a0” is reflected in “sound” and “resister C”(no scale correction).

  2. 2

    If you want to use it as WeDo, you need to use “NanoBoardAGWithMotors.image” instead of standard “Scratch image” of Scratch 1.4.

    The output port “d9” is for “motor A”.
    The output port “d5” is for “motor B”.
    When the rotate direction of “motor A” is “this way”, the output port “d1” is HIGH.

  3. 3

    You can give any value of power from 0 to 100 for each motors, but it changes by 8 steps (includes 0).
    If you need more power steps, please use “littleBitsAsScratchSensorBoardSingle.ino” and “NanoBoardAGWithMotor.image" in http://squeakland.jp/abee/tmp/NanoBoardAGWithMotor.zip .
    It supports only one motor but 128 power steps.

    The output port “d9” is for “motor”.
    When the rotate direction of “motor” is “this way”, the output port “d1” is HIGH.
    When the rotate direction of “motor” is “that way”, the output port “d5” is HIGH.

  4. 4

    You may find further information in the sketch file.

    Enjoy!
    Bits used: Arduino

Credits

The Arduino sketch is based on NanoBoard by by Tomo Niimura. And NanoBoard is based on HelloBoardV2 by PINY and Song Hojun. Those sketches are licensed under CC BY-SA. https://creativecommons.org/licenses/by-sa/3.0/ Scratch Source Code is licensed under Scratch Source Code License by MIT. http://wiki.scratch.mit.edu/wiki/Scratch_Source_Code_License NanoBoardAGWithMotor and NanoBoardAGWithMotors are licensed under MIT license by Kazuhiro Abe. http://swikis.ddo.jp/WorldStethoscope/47

Bits used (1)

Accessories used (2)

Kits

You can also save big by getting all these bits and more in this kit:

Collections

Add this collection to get these modules and more for a price savings

Tools (2)

  • Arduino IDE
  • Scratch
  • 5 Comments
  • Steve Marks 4 months ago

    Does littleBits have further plans for Scratch integration or will it focus most of its energy on the Arduino/Processing interface? I like the possibilities of Arduino/Processing, but Scratch makes it an easy interface for working with kids.

    • littleBits 4 months ago

      Hi Steve,

      Yes! There are plans for Scratch integration in the future. Stay tuned.

  • oshe10 4 months ago

    Hi,
    Could you please tell me the script for the paddle. i have most of it except for the last part of the script.

    • abee 4 months ago

      I shared this project as follows. http://scratch.mit.edu/projects/23452979/
      Please do not forget to connect your littleBits (or other PicoBoard compatible board) at first.

  • alin 13 days ago

    Hey Abee,

    This is really great. We've been working on a very full-featured Scratch extension for Scratch 2.0. While doing that we put together a modification of the Scratch for Arduino Project (S4A: http://s4a.cat/). It uses a specially modified version of Scratch 1.4. We modified their code so that you can use it with the littleBits Arduino Module directly (you don't have to emulate anything else).Stay tuned for our Scratch 2.0 extension, but in the meantime try out our "Alpha" work, and if you have any questions about it, just ask us for help on the littleBits Arduino forum.

    https://github.com/littlebits/lbScratch/blob/master/Scratch-14/binaries/LB_S4A.dmg.zip?raw=true

    Oh yeah, and it seems Kreg Hanning has decided to host a Google Hangout about Scratch 2.0. We'd love to see you there:
    https://plus.google.com/events/cvdco11d41r4k62dhge4r35kbak

Must be logged in to comment. Sign in. Not a member? Join now