raspi_lcd 0.8 → 0.81

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.
@@ -163,7 +163,7 @@ static VALUE r_Button(VALUE self, VALUE button)
163
163
  res = BUTTON_DOWN;
164
164
  else res = -1;
165
165
  if(res==-1) {
166
- rb_raise(rb_eStandardError,"only up, left, center, right and down are valid parameters");
166
+ rb_raise(rb_eStandardError,"only :up, :left, :center, :right and :down are valid parameters");
167
167
  return Qnil;
168
168
  }
169
169
  else
@@ -186,7 +186,7 @@ static VALUE r_ButtonPressed(VALUE self, VALUE button)
186
186
  res = BUTTON_PRESSED_DOWN;
187
187
  else res = -1;
188
188
  if(res==-1) {
189
- rb_raise(rb_eStandardError,"only up, left, center, right and down are valid parameters");
189
+ rb_raise(rb_eStandardError,"only :up, :left, :center, :right and :down are valid parameters");
190
190
  return Qnil;
191
191
  }
192
192
  else
data/lib/raspi_lcd.rb CHANGED
@@ -1,5 +1,13 @@
1
1
  require 'raspi_lcd/raspi_lcd'
2
2
 
3
3
  module RaspiLCD
4
-
5
- end
4
+ DIRECTIONS = [:up, :left, :center, :right, :down]
5
+
6
+ def buttons
7
+ DIRECTIONS.select{|d| button(d)}
8
+ end
9
+
10
+ def buttons_pressed
11
+ DIRECTIONS.select{|d| button_pressed(d)}
12
+ end
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raspi_lcd
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.8'
4
+ version: '0.81'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: