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 third light (which is also Sparkle)(off 3) ; turn off the third light (on all) ; turn on all lights
(on 5 10) ; turn on the 5th light even more slowly, over 10 seconds (on all 10) ; turn on all lights slowly
(always (if (touched) (right 2))) (always (if (touched) (on random))) turn on a random light every time it's touched ; using (multiple) keeps a previous light on ; so each time you touch, more lights come on, until they're all lit ; if you touch again when all are lit, they all turn off again to restart the cycle (multiple) (always (if (touched) (on random))) turn on a random light every time it's touched ; first turn all lights on, then turn a random one off till they're all off ; if you touch again when all are off, they all turn on again to restart the cycle (multiple) (left 1) (always (if (touched) (off random))) turn off a random light every time it's touched ; flash the lights only when the sensor value is greater than 3 ; connect the sound sensor to activate with conversation ; connect the motion sensor to activate when you move (always (if (> sensor 3) (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) (flash 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)) ; with multiple mode, turn lights on, one by one, till they are all lit ; then with countdown mode, turn off the lights, one by one (always (multiple) (right 2) (wait 10) (countdown) (left 2) (wait 10)) ; turn on the motor, fade left, turn off motor, fade right (always (motor on) (left 5) (motor off) (right 5)) ; create an attention-getting flash if your design hasn't been touched in 90 seconds ; if you touched it within 90 seconds, flash Sparkle and then reset (always (if (touched) (flash 5) ((wait 90) (repeat 10 (left 1/2) (right 1/2) )))) ; flash slowly over 5 seconds, wait 30 seconds, twinkle all the lights for about 3 minutes, then turn off. ; the maximum number you can use for repeats is 10 so we have to nest repeats like this (flash 5) (wait 30) (repeat 5 (repeat 10 (repeat 10 (twinkle 1/2)))) (always (wait 1)) ; defined procedures can help organize your programs (define (pulse) (flash 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:
(speed 5) ; set the overall transition speed to 5 seconds
(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.
|