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.
(if (> sensor 5)
(right 2) ; do this if the board is touched
(left 2))) ; otherwise do that
((left 2)(right 2)) ; do these if the board is touched
((in 1)(out 2)) ) ; otherwise do these
(if (< sensor 2) (center 5))
(if (touched) (twinkle 2)))
(twinkle sensor)) ; automatically speed up in a bright room, slow down in the dark
(repeat 3 (right 2) (left 2))
(repeat sensor (right 2) (left 2)) ; repeat automatically 1-10 times based on sensor level
; build up the lights, one by one till they are all lit
; then with countdown mode, turn off the lights, one by one
(build) (right 2)
(countdown) (left 2)
; 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
((wait 90) (repeat 10 (left 1/2) (right 1/2) ))))
; defined procedures can help organize your programs
(center 1) (wait 1))
(repeat 2 (pulse)) (out 2))
(define (racing n)
(repeat n (left 1/4) (right 1/4)))
((heartbeat) (wait 30))))
; alternate the direction of a flashing pattern each time you touch
(define (alternate n)
( (if (even n) (left 1) (right 1))
(alternate (+1 n)) )
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:
(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)
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
Sparkle is not intended to be a reference implementation of either.
The language is influenced by our friends
Kindergarten Group and by our experience at the Craft Technology