]> git.zerfleddert.de Git - fnordlicht-mini/blame - firmware/tests/change_current.rb
reference firmware
[fnordlicht-mini] / firmware / tests / change_current.rb
CommitLineData
ec1bef8e 1#!/usr/bin/env ruby
2
3$:.unshift(File.dirname(__FILE__)+"/lib")
4
5require 'fnordlicht'
6require 'serialport'
7
8include Fnordlicht
9
10$dev = SerialPort.new("/dev/ttyUSB0", 19200)
11
12puts "sending sync sequence"
13sync()
14puts "stop fading"
15stop(255)
16
17puts "fade to hsv color"
18fade_hsv(255, 200, 100, 100, 2, 1)
19sleep 2
20
21puts "change current color - rgb"
22modify_current(255, 1, 1, 50, 0, 0, 0, 0, 0)
23sleep 2
24modify_current(255, 1, 1, 50, 0, 0, 0, 0, 0)
25sleep 2
26modify_current(255, 1, 1, 50, 0, 0, 0, 0, 0)
27sleep 2
28modify_current(255, 1, 1, -80, 0, 0, 0, 0, 0)
29sleep 2
30modify_current(255, 1, 1, -100, 100, 127, 0, 0, 0)
31sleep 2
32
33puts "change current color - hsv"
34fade_hsv(255, 60, 220, 120, 5, 1)
35sleep 2
36
37modify_current(255, 2, 1, 0, 0, 0, 235, 0, 0)
38sleep 2
39modify_current(255, 2, 1, 0, 0, 0, 235, 0, 0)
40sleep 2
41modify_current(255, 2, 1, 0, 0, 0, 235, 0, 0)
42sleep 2
43modify_current(255, 2, 1, 0, 0, 0, 235, 0, 0)
44sleep 2
450.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
50end
Impressum, Datenschutz