]>
Commit | Line | Data |
---|---|---|
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 | ||
15 | stop(255) | |
16 | ||
17 | puts "starting slow fade from red to green" | |
18 | fade_rgb(255, 255, 0, 0, 255, 1) | |
19 | sleep 0.1 | |
20 | ||
21 | puts "save start color" | |
22 | save_current(255, 0, 8, 1, 10) | |
23 | ||
24 | fade_rgb(255, 0, 255, 0, 1, 2) | |
25 | ||
26 | sleep 1.8 | |
27 | puts "save in the middle" | |
28 | save_current(255, 1, 8, 1, 10) | |
29 | ||
30 | sleep 3 | |
31 | puts "save at the end" | |
32 | save_current(255, 2, 8, 1, 10) | |
33 | ||
34 | sleep 0.1 | |
35 | ||
36 | puts "start program replay, 0-2, repeat from start" | |
37 | start_program(255, 2, [0, 2, 1]) |