digiusb 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/examples/digiblink.rb +17 -0
  2. data/lib/digiusb.rb +2 -2
  3. data/license.txt +106 -1
  4. metadata +3 -2
@@ -0,0 +1,17 @@
1
+ # A little example program for driving the digirgb example code
2
+ # needs colorist rubygem to parse colors
3
+ require 'digiusb'
4
+ require 'colorist'
5
+
6
+ light = DigiUSB.sparks.last # get the spark most recently plugged in (or maybe just a random one? not sure)
7
+ raise "Couldn't find a DigiUSB device to talk to" if light.nil?
8
+
9
+ color = ARGV.first.to_color
10
+
11
+ # send out each byte
12
+ light.putc 's' # start character
13
+ light.putc color.r
14
+ light.putc color.g
15
+ light.putc color.b
16
+
17
+ puts "Light is now #{ARGV.first}"
data/lib/digiusb.rb CHANGED
@@ -32,7 +32,7 @@ class DigiUSB
32
32
 
33
33
  # write a single character
34
34
  def putc character
35
- character = [character].pack('c') if character.is_a? Integer
35
+ character = [character % 256].pack('c') if character.is_a? Integer
36
36
  raise "Cannot putc more than one byte" if character.bytesize > 1
37
37
  raise "Cannot putc fewer than one byte" if character.bytesize < 1
38
38
 
@@ -72,7 +72,7 @@ class DigiUSB
72
72
  end
73
73
 
74
74
  def inspect
75
- "<Digispark:#{@device.product}:@#{@device.bus_number}->#{@device.device_address}>"
75
+ "<Digispark:#{@device.product}:@#{@device.bus_number}.#{@device.device_address}>"
76
76
  end
77
77
  alias_method :to_s, :inspect
78
78
 
data/license.txt CHANGED
@@ -1 +1,106 @@
1
- Do whatever you like with it!
1
+ sid vicious played a four-string fender bass guitar and couldn’t sing
2
+ and everybody hated him except the ones who loved him
3
+ a ukulele has four strings, but sid did did not play ukulele
4
+ he did smack and probably killed his girlfriend nancy spungen
5
+
6
+ if only sid had had a ukulele, maybe he could have been happy
7
+ maybe he would not have suffered such a sad end
8
+ he maybe would have not done all that heroin instead
9
+ he maybe would’ve sat around just singing nice songs to his girlfriend
10
+
11
+ so play your favorite cover song, especially if the words are wrong
12
+ ‘cos even if your grades are bad, it doesn’t mean you’re failing
13
+ do your homework with a fork
14
+ and eat your fruit loops in the dark
15
+ and bring your etch-a-sketch to work
16
+ and play your ukulele
17
+
18
+ ukulele small and forceful
19
+ brave and peaceful
20
+ you can play the ukulele too it is painfully simple
21
+ play your ukulele badly, play your ukulele loudly
22
+ ukulele banish evil
23
+ ukulele save the people
24
+ ukulele gleaming golden on the top of every steeple
25
+
26
+ lizzie borden took an axe, and gave her father forty whacks
27
+ then gave her mother forty-one, and left a tragic puzzle
28
+ if only they had given her an instrument, those puritans
29
+ had lost the plot completely
30
+ see what happens when you muzzle
31
+ a person’s creativity
32
+ and do not let them sing and scream
33
+ and nowadays it’s worse ‘cause kids have automatic handguns
34
+ it takes about an hour to learn how to play the ukulele
35
+ about same to teach someone to build a standard pipe bomb
36
+ YOU DO THE MATH
37
+
38
+ so play your favorite cover song, especially if the words are wrong
39
+ ‘cos even if your grades are bad, it doesn’t mean you’re failing
40
+ do your homework with a fork
41
+ and eat your fruit loops in the dark
42
+ and bring your flask of jack to work
43
+ and play your ukulele
44
+
45
+ ukulele, thing of wonder
46
+ ukulele, wand of thunder
47
+ you can play the ukulele, too
48
+ in london and down under
49
+ play joan jett, and play jacques brel
50
+ and eminem and neutral milk hotel
51
+ the children crush the hatred
52
+ play your ukulele naked
53
+ and if anybody tries to steal your ukulele, let them take it
54
+
55
+ imagine there’s no music, imagine there are no songs
56
+ imagine that john lennon wasn’t shot in front of his apartment
57
+ imagine if john lennon had composed “imagine” on the ukulele
58
+ maybe folks would have more clearly got the message
59
+
60
+ you may think my approach is simple-minded and naïve
61
+ like if you want to save the world then why not quit and feed the hungry
62
+ but people for millennia have needed music to survive
63
+ and that’s why i’ve promised john that i will not feel guilty
64
+
65
+ so play your favorite beatles’ song
66
+ and make the subway fall in love
67
+ they’re only $19.95, that’s not a lot of money
68
+ play until the sun comes up
69
+ and play until your fingers suffer
70
+ play LCD soundsystem songs on your ukulele
71
+ quit the bitching on your blog
72
+ and stop pretending art is hard
73
+ just limit yourself to three chords
74
+ and do not practice daily
75
+ you’ll minimize some stranger’s sadness
76
+ with a piece of wood and plastic
77
+ holy fuck it’s so fantastic, playing ukulele
78
+ eat your homework with a fork
79
+ and do your fruit loops in the dark
80
+ bring your etch-a-sketch to work
81
+ your flask of jack
82
+ your vibrator
83
+ your fear of heights
84
+ your nikon lens
85
+ your mom and dad
86
+ your disco stick
87
+ your soundtrack from “karate kid”
88
+ your ginsu knives
89
+ your rosary
90
+ your new rebecca black CD
91
+ your favorite room
92
+ your bowie knife
93
+ your stuffed giraffe
94
+ your new glass eye
95
+ your sousaphone
96
+ your breakfast tea
97
+ your nick drake tapes
98
+ your giving tree
99
+ your ice cream truck
100
+ your missing wife
101
+ your will to live
102
+ your urge to cry
103
+ remember we’re all going to die
104
+ so PLAY YOUR UKULELE
105
+
106
+ — Amanda Palmer
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digiusb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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: 2013-01-03 00:00:00.000000000 Z
12
+ date: 2013-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: libusb
@@ -40,6 +40,7 @@ files:
40
40
  - lib/digiusb.rb
41
41
  - readme.txt
42
42
  - license.txt
43
+ - examples/digiblink.rb
43
44
  - examples/finn.rb
44
45
  - !binary |-
45
46
  YmluL2RpZ2l0ZXJt