Category Archives: Scratch

Laser Cut Scratch Cat

Wyolum got me a laser to expand our distributed prototyping capability. I’ll have more on that later, but I made a little trinket for Scratch classes that I’ve been teaching.

scratch-lasered

I had difficulty finding a vector file good for lasering, so I made this one. Nice handout for Scratch classes

The official SVG version has overlapping paths that rely on fills to hide some of the shapes.

I traced a bitmap version in inkscape and did a little cleanup. It’s still not perfect with some double lines.

I’ll try to do a better trace to improve but this one cuts ok.

Update: done

v1-v2-comp

You can find the SVG over at Youmagine.com: https://youmagine.com/designs/laser-cut-scratch-cat

Note that the Scratch cat image and logo are trademarks of the Lifelong Kindergarten Group at MIT. Check out Scratch at http://scratch.mit.edu

Arduino Library for Scratch Sensor Board Emulation

I re-wrote the simple sketch as an Arduino Library for Scratch Sensor Board (picoboard) emulation.

You can download it at github

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():

Scratchboard.Values[RESISTA] = analogRead(A0);
Scratchboard.Values[RESISTB] = analogRead(A1);
Scratchboard.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.