]>
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 "fade to hsv color" | |
18 | fade_hsv(255, 200, 100, 100, 2, 1) | |
19 | sleep 2 | |
20 | ||
21 | puts "change current color - rgb" | |
22 | modify_current(255, 1, 1, 50, 0, 0, 0, 0, 0) | |
23 | sleep 2 | |
24 | modify_current(255, 1, 1, 50, 0, 0, 0, 0, 0) | |
25 | sleep 2 | |
26 | modify_current(255, 1, 1, 50, 0, 0, 0, 0, 0) | |
27 | sleep 2 | |
28 | modify_current(255, 1, 1, -80, 0, 0, 0, 0, 0) | |
29 | sleep 2 | |
30 | modify_current(255, 1, 1, -100, 100, 127, 0, 0, 0) | |
31 | sleep 2 | |
32 | ||
33 | puts "change current color - hsv" | |
34 | fade_hsv(255, 60, 220, 120, 5, 1) | |
35 | sleep 2 | |
36 | ||
37 | modify_current(255, 2, 1, 0, 0, 0, 235, 0, 0) | |
38 | sleep 2 | |
39 | modify_current(255, 2, 1, 0, 0, 0, 235, 0, 0) | |
40 | sleep 2 | |
41 | modify_current(255, 2, 1, 0, 0, 0, 235, 0, 0) | |
42 | sleep 2 | |
43 | modify_current(255, 2, 1, 0, 0, 0, 235, 0, 0) | |
44 | sleep 2 | |
45 | 0.upto 2 do | |
46 | modify_current(255, 5, 1, 0, 0, 0, 0, 0, -80) | |
47 | sleep 1 | |
48 | modify_current(255, 5, 1, 0, 0, 0, 0, 0, 80) | |
49 | sleep 1 | |
50 | end |