]>
Commit | Line | Data |
---|---|---|
ec1bef8e | 1 | #!/usr/bin/env ruby |
2 | ||
3 | $:.unshift(File.dirname(__FILE__)+"/lib") | |
4 | ||
5 | require 'fnordlicht' | |
6 | require 'serialport' | |
7 | ||
8 | include Fnordlicht | |
9 | ||
10 | $dev = SerialPort.new("/dev/ttyUSB0", 19200) | |
11 | ||
12 | puts "sending sync sequence" | |
13 | sync() | |
14 | puts "stop fading" | |
15 | stop(255) | |
16 | ||
17 | puts "save 11 random hue values (hsv) in eeprom" | |
18 | 0.upto 10 do |i| | |
19 | hue = rand(360) | |
20 | puts "hue: %u" % hue | |
21 | save_hsv(255, i, hue, 255, 255, 10, 1, 10); | |
22 | sleep 0.1 | |
23 | end | |
24 | ||
25 | puts "fade to blue" | |
26 | fade_hsv(255, 240, 255, 255, 10, 1) | |
27 | ||
28 | sleep 2 | |
29 | ||
30 | puts "start program replay, 3-7 no repeat" | |
31 | start_program(255, 2, [3, 7, 0]) | |
32 | ||
33 | sleep 10 | |
34 | ||
35 | puts "start program replay, 5-7 repeat from start" | |
36 | start_program(255, 2, [5, 7, 1]) | |
37 | ||
38 | sleep 20 | |
39 | ||
40 | puts "start program replay, 5-7 repeat inverse" | |
41 | start_program(255, 2, [5, 7, 2]) |