Sparkle programs are actions and numbers
grouped with parentheses.
Jump to summary.
There are five unique lights in a Sparkle system, (you can have more than 5, just that some of them will light up together). In (right 2), right is the command to fade the lights right, and 2 makes the total cycle 2 seconds long. If you prefer a light to stay on, type: (on 3) ; turn on the middle light (which is also Sparkle)(off 3) ; turn off the middle light (on 10) ; turn on all lights The numbers 1-5 are for specific lights, and 6-10 turn on combinations of lights. Experiment. (always (if (touched) (right 2))) (always (if (> sensor 5) (right 2))) (always (if (touched) (right 2) ; do this if the board is touched (left 2))) ; otherwise do that (always (if (touched) ((left 2)(right 2)) ; do these if the board is touched ((in 1)(out 2)) ) ; otherwise do these (wait 10)) (always (if (< sensor 2) (center 5)) (if (touched) (twinkle 2))) (always (twinkle sensor)) ; automatically speed up in a bright room, slow down in the dark (always (repeat 3 (right 2) (left 2)) (wait 10)) (always (repeat sensor (right 2) (left 2)) ; repeat automatically 1-10 times based on sensor level (wait 10)) ; build up the lights, one by one till they are all lit ; then with countdown mode, turn off the lights, one by one (always (build) (right 2) (wait 10) (countdown) (left 2) (wait 10)) ; create an attention-getting flash if your design hasn't been touched in 90 seconds ; if you touched it within 90 seconds, pulse only the center light and then reset (always (if (touched) (center 5) ((wait 90) (repeat 10 (left 1/2) (right 1/2) )))) ; defined procedures can help organize your programs (define (pulse) (center 1) (wait 1)) (define (heartbeat) (repeat 2 (pulse)) (out 2)) (define (racing n) (repeat n (left 1/4) (right 1/4))) (always (if (touched) (racing sensor) ((heartbeat) (wait 30)))) ; alternate the direction of a flashing pattern each time you touch (define (alternate n) (if (touched) ( (if (even n) (left 1) (right 1)) (alternate (+1 n)) ) (alternate n))) (alternate 1) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In addition to picking colors from the graphical list, you can also tell
Colorwell which colors you want by typing:
Where the number 1 - 10 corresponds to the 10 colors in the PANTONE® fashion color report. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Here's a short program to gradually change between two colors:
(always (color 7) ; turn to the 7th color of the season (sweet lilac® in Spring 2012) (wait 30) ; wait for 30 seconds in the current color (color 2) ; then turn to the 2nd color of the season (tangerine tango® in Spring 2012) (wait 30)) It's impossible for these colors to match the actual PANTONE® colors, for one basic reason: mixing colors with LEDs is an additive process where dark tones (like brown) just cannot be reproduced. We try our best, and are finding ways to improve the accuracy. To mix your own colors, type: (mix 4 9 1) The numbers are the amount of red, green, and blue to add together. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
All Sparkle/Colorwell procedures
Although inspired by
Scheme and
Logo,
Sparkle is not intended to be a reference implementation of either.
The language is influenced by our friends
at the
Lifelong
Kindergarten Group and by our experience at the Craft Technology
Group.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||