blinky 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -57,9 +57,10 @@ Not sure which light is which?
57
57
  == What is currently supported?
58
58
 
59
59
  === Lights/ Build Indicators
60
- * Delcom Engineering USB Visual Indicator Generation I
61
- * Delcom Engineering USB Visual Indicator Generation II
62
-
60
+ * {ThingM blink(1)}[http://www.kickstarter.com/projects/thingm/blink1-the-usb-rgb-led]
61
+ * {Delcom Engineering USB Visual Indicator Generation I}[http://www.delcomproducts.com/products_usblmp.asp]
62
+ * {Delcom Engineering USB Visual Indicator Generation II}[http://www.delcomproducts.com/products_usblmp.asp]
63
+
63
64
  === Operating Systems
64
65
  * OSX
65
66
  * Linux
@@ -75,23 +76,23 @@ Any server that supports the {cctray}[http://confluence.public.thoughtworks.org/
75
76
 
76
77
  == How Do I install blinky?
77
78
 
78
- === 1) Install support for lib-usb-1.0 (http://www.libusb.org)
79
-
80
- ==== OSX and Linux
79
+ === OSX and Linux
81
80
 
82
- Install lib-usb-1.0 with your favourite package manager.
81
+ Install lib-usb-1.0 with your favourite package manager, and then install the blinky gem
83
82
 
84
83
  For example, on OSX:
85
84
 
86
85
  brew install libusb
86
+ gem install blinky
87
87
 
88
88
  on Debian or Ubuntu:
89
89
 
90
- $ sudo apt-get install libusb-1.0-0-dev
90
+ apt-get install libusb-1.0-0-dev
91
+ gem install blinky
91
92
 
92
93
  and so on
93
94
 
94
- ==== Windows
95
+ === Windows
95
96
 
96
97
  Windows can be a bit fiddly. The following is how I got a Delcomm II light to work on a Windows 7 laptop.
97
98
  Further experience reports/better instructions would be gratefully received.
@@ -102,12 +103,9 @@ Further experience reports/better instructions would be gratefully received.
102
103
  * opened Zadig and selected 'Options -> List All Devices'
103
104
  * Selected 'USB Input Device' in the Zadig drop-down
104
105
  * Clicked on 'Replace Driver' and confirmed in the popup dialog
105
-
106
- === 2) Install the blinky gem
107
-
108
- gem install blinky
109
-
110
- === 3) Test your installation
106
+ * installed the blinky gem
107
+
108
+ === Test your installation
111
109
 
112
110
  Plug in your light and then do this:
113
111
 
@@ -1,3 +1,3 @@
1
1
  module Blinky
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -0,0 +1,64 @@
1
+ module Blinky
2
+ module ThingM
3
+ module Blink1
4
+
5
+ def success!
6
+ stop
7
+ set_colour("\x00\xFF\x00")
8
+ end
9
+
10
+ def failure!
11
+ stop
12
+ set_flash_pattern("\xFF\x00\x00")
13
+ play
14
+ end
15
+
16
+ def building!
17
+ stop
18
+ set_colour("\x00\x00\xFF")
19
+ end
20
+
21
+ def warning!
22
+ stop
23
+ set_colour("\xFF\xBE\x00")
24
+ end
25
+
26
+ def off!
27
+ stop
28
+ set_colour("\x00\x00\x00")
29
+ end
30
+
31
+ private
32
+ def set_colour colour
33
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01\x6E#{colour}\x00\x00\x00\x00", 1000)
34
+ end
35
+
36
+ def play
37
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01p\x01\x01\x00\x00\x00\x00\x00", 1000)
38
+ end
39
+
40
+ def stop
41
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01p\x00\x01\x00\x00\x00\x00\x00", 1000)
42
+ end
43
+
44
+ def set_flash_pattern colour
45
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P#{colour}\x00\x0A\x00\x00", 1000)
46
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x0A\x01\x00", 1000)
47
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x00\x02\x00", 1000)
48
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x00\x03\x00", 1000)
49
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x00\x04\x00", 1000)
50
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x00\x05\x00", 1000)
51
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x00\x06\x00", 1000)
52
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x00\x07\x00", 1000)
53
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x00\x08\x00", 1000)
54
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x00\x09\x00", 1000)
55
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x00\x0A\x00", 1000)
56
+ @handle.usb_control_msg(0x21, 0x09, (3 << 8) | 1, 0, "\x01P\x00\x00\x00\x00\x00\x0B\x00", 1000)
57
+ end
58
+
59
+ end
60
+ end
61
+ end
62
+
63
+
64
+
@@ -5,6 +5,10 @@ recipe DelcomEngineering::VisualIndicator::GenerationI, {:usb_vendor_id => 0x0f
5
5
  recipe DelcomEngineering::VisualIndicator::GenerationII, {:usb_vendor_id => 0x0fc5,
6
6
  :usb_product_id => 0xb080,
7
7
  :description => "USB Visual Signal Indicator Gen II"}
8
+
9
+ recipe ThingM::Blink1, {:usb_vendor_id => 0x27b8,
10
+ :usb_product_id => 0x01ed,
11
+ :description => "ThingM Blink(1)"}
8
12
 
9
13
 
10
14
  #TODO - use treeop to allow a syntax like this
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blinky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-14 00:00:00.000000000 Z
12
+ date: 2013-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: libusb
@@ -99,6 +99,7 @@ files:
99
99
  - lib/ci_server_plugins/test_server_plugin.rb
100
100
  - lib/device_recipes/delcom_engineering/visual_indicator_gen_one.rb
101
101
  - lib/device_recipes/delcom_engineering/visual_indicator_gen_two.rb
102
+ - lib/device_recipes/thing_m/blink_1.rb
102
103
  - lib/plugins.rb
103
104
  - lib/recipes.rb
104
105
  - notes.txt