phidgets 0.0.5 → 0.1.0
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.
- data/History.txt +10 -2
- data/README.rdoc +41 -18
- data/Rakefile +31 -20
- data/bin/phidget +29 -44
- data/ext/phidgets/extconf.rb +14 -0
- data/ext/phidgets/phidgets.c +272 -0
- data/ext/phidgets/phidgets.h +82 -0
- data/ext/phidgets/phidgets_accelerometer.c +165 -0
- data/ext/phidgets/phidgets_advanced_servo.c +567 -0
- data/ext/phidgets/phidgets_analog.c +139 -0
- data/ext/phidgets/phidgets_bridge.c +263 -0
- data/ext/phidgets/phidgets_common.c +454 -0
- data/ext/phidgets/phidgets_dictionary.c +279 -0
- data/ext/phidgets/phidgets_encoder.c +249 -0
- data/ext/phidgets/phidgets_frequency_counter.c +241 -0
- data/ext/phidgets/phidgets_gps.c +235 -0
- data/ext/phidgets/phidgets_interface_kit.c +340 -0
- data/ext/phidgets/phidgets_ir.c +251 -0
- data/ext/phidgets/phidgets_led.c +178 -0
- data/ext/phidgets/phidgets_manager.c +366 -0
- data/ext/phidgets/phidgets_motor_control.c +642 -0
- data/ext/phidgets/phidgets_phsensor.c +208 -0
- data/ext/phidgets/phidgets_rfid.c +281 -0
- data/ext/phidgets/phidgets_servo.c +276 -0
- data/ext/phidgets/phidgets_spatial.c +369 -0
- data/ext/phidgets/phidgets_stepper.c +560 -0
- data/ext/phidgets/phidgets_temp_sensor.c +295 -0
- data/ext/phidgets/phidgets_text_lcd.c +381 -0
- data/ext/phidgets/phidgets_text_led.c +107 -0
- data/ext/phidgets/phidgets_weight_sensor.c +113 -0
- data/lib/phidgets/accelerometer.rb +25 -0
- data/lib/phidgets/advanced_servo.rb +49 -0
- data/lib/phidgets/analog.rb +8 -0
- data/lib/phidgets/bridge.rb +25 -0
- data/lib/phidgets/common.rb +75 -190
- data/lib/phidgets/dictionary.rb +53 -0
- data/lib/phidgets/encoder.rb +49 -0
- data/lib/phidgets/frequency_counter.rb +25 -0
- data/lib/phidgets/gps.rb +37 -0
- data/lib/phidgets/interfacekit.rb +38 -128
- data/lib/phidgets/ir.rb +50 -0
- data/lib/phidgets/led.rb +8 -0
- data/lib/phidgets/manager.rb +67 -119
- data/lib/phidgets/motor_control.rb +110 -0
- data/lib/phidgets/ph_sensor.rb +25 -0
- data/lib/phidgets/rfid.rb +38 -111
- data/lib/phidgets/servo.rb +12 -95
- data/lib/phidgets/spatial.rb +25 -0
- data/lib/phidgets/stepper.rb +61 -0
- data/lib/phidgets/temperature_sensor.rb +25 -0
- data/lib/phidgets/text_lcd.rb +8 -0
- data/lib/phidgets/text_led.rb +8 -0
- data/lib/phidgets/weight_sensor.rb +25 -0
- data/lib/phidgets.rb +22 -3
- data/phidgets.gemspec +42 -0
- data/test/test_accelerometer.rb +47 -0
- data/test/test_advanced_servo.rb +152 -0
- data/test/test_analog.rb +45 -0
- data/test/test_bridge.rb +77 -0
- data/test/test_common.rb +167 -0
- data/test/test_dictionary.rb +82 -0
- data/test/test_encoder.rb +67 -0
- data/test/test_frequency_counter.rb +67 -0
- data/test/test_gps.rb +67 -0
- data/test/test_helper.rb +1 -0
- data/test/test_interfacekit.rb +86 -182
- data/test/test_ir.rb +57 -0
- data/test/test_led.rb +55 -0
- data/test/test_manager.rb +94 -0
- data/test/test_motor_control.rb +172 -0
- data/test/test_phidgets.rb +14 -6
- data/test/test_phsensor.rb +62 -0
- data/test/test_rfid.rb +77 -0
- data/test/test_servo.rb +67 -0
- data/test/test_spatial.rb +112 -0
- data/test/test_stepper.rb +163 -0
- data/test/test_temp_sensor.rb +87 -0
- data/test/test_text_lcd.rb +115 -0
- data/test/test_text_led.rb +35 -0
- data/test/test_weight_sensor.rb +32 -0
- metadata +165 -75
- data/Manifest.txt +0 -21
- data/PostInstall.txt +0 -3
- data/README.txt +0 -87
- data/lib/phidgets/phidgets.rb +0 -225
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
@@ -0,0 +1,87 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestPhidgetsTemperatureSensor < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_create
|
6
|
+
assert_nothing_raised {Phidgets::TemperatureSensor.new}
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_get_temperature_input_count
|
10
|
+
sensor = Phidgets::TemperatureSensor.new
|
11
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.temperature_input_count}
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_get_temperature
|
15
|
+
sensor = Phidgets::TemperatureSensor.new
|
16
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.temperature 1}
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_get_temperature_min
|
20
|
+
sensor = Phidgets::TemperatureSensor.new
|
21
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.temperature_min 1}
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_get_temperature_max
|
25
|
+
sensor = Phidgets::TemperatureSensor.new
|
26
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.temperature_max 1}
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_get_temperature_change_trigger
|
30
|
+
sensor = Phidgets::TemperatureSensor.new
|
31
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.temperature_change_trigger 1}
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_set_temperature_change_trigger
|
35
|
+
sensor = Phidgets::TemperatureSensor.new
|
36
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.set_temperature_change_trigger 1, 1.5}
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_get_potential
|
40
|
+
sensor = Phidgets::TemperatureSensor.new
|
41
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.potential 1}
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_get_potential_min
|
45
|
+
sensor = Phidgets::TemperatureSensor.new
|
46
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.potential_min 1}
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_get_potential_max
|
50
|
+
sensor = Phidgets::TemperatureSensor.new
|
51
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.potential_max 1}
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_get_ambient_temperature
|
55
|
+
sensor = Phidgets::TemperatureSensor.new
|
56
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.ambient_temperature}
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_get_ambient_temperature_min
|
60
|
+
sensor = Phidgets::TemperatureSensor.new
|
61
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.ambient_temperature_min}
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_get_ambient_temperature_max
|
65
|
+
sensor = Phidgets::TemperatureSensor.new
|
66
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.ambient_temperature_max}
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_get_thermocouple_type
|
70
|
+
sensor = Phidgets::TemperatureSensor.new
|
71
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.thermocouple_type 1}
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_set_thermocouple_type
|
75
|
+
sensor = Phidgets::TemperatureSensor.new
|
76
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.set_thermocouple_type 1, Phidgets::TemperatureSensor::J_TYPE}
|
77
|
+
end
|
78
|
+
|
79
|
+
unless RUBY_VERSION < '1.9.0'
|
80
|
+
def test_set_on_temperature_change
|
81
|
+
sensor = Phidgets::TemperatureSensor.new
|
82
|
+
assert_nothing_raised {sensor.on_temperature_change {puts 'hello'}}
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
|
@@ -0,0 +1,115 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestPhidgetsTextLCD < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_create
|
6
|
+
assert_nothing_raised {Phidgets::TextLCD.new}
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_get_row_count
|
10
|
+
lcd = Phidgets::TextLCD.new
|
11
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.row_count}
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_get_column_count
|
15
|
+
lcd = Phidgets::TextLCD.new
|
16
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.column_count}
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_get_backlight
|
20
|
+
lcd = Phidgets::TextLCD.new
|
21
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.backlight?}
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_set_backlight
|
25
|
+
lcd = Phidgets::TextLCD.new
|
26
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.backlight = true}
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_get_brightness
|
30
|
+
lcd = Phidgets::TextLCD.new
|
31
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.brightness}
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_set_brightness
|
35
|
+
lcd = Phidgets::TextLCD.new
|
36
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.brightness = 55}
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_get_contrast
|
40
|
+
lcd = Phidgets::TextLCD.new
|
41
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.contrast}
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_set_contrast
|
45
|
+
lcd = Phidgets::TextLCD.new
|
46
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.contrast = 87}
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_get_cursor_on
|
50
|
+
lcd = Phidgets::TextLCD.new
|
51
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.cursor_on?}
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_set_cursor_on
|
55
|
+
lcd = Phidgets::TextLCD.new
|
56
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.cursor_on = true}
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_get_cursor_blink
|
60
|
+
lcd = Phidgets::TextLCD.new
|
61
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.cursor_blink?}
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_set_cursor_blink
|
65
|
+
lcd = Phidgets::TextLCD.new
|
66
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.cursor_blink = true}
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_set_custom_character
|
70
|
+
lcd = Phidgets::TextLCD.new
|
71
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.custom_character 2, 31, 32}
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_set_display_character
|
75
|
+
lcd = Phidgets::TextLCD.new
|
76
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.display_character 5, 10, 'P'}
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_set_display_string
|
80
|
+
lcd = Phidgets::TextLCD.new
|
81
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.display_string 10, 'Hello'}
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_get_screen_count
|
85
|
+
lcd = Phidgets::TextLCD.new
|
86
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.screen_count}
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_get_screen
|
90
|
+
lcd = Phidgets::TextLCD.new
|
91
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.screen}
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_set_screen
|
95
|
+
lcd = Phidgets::TextLCD.new
|
96
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.screen = 1}
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_get_screen_size
|
100
|
+
lcd = Phidgets::TextLCD.new
|
101
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.screen_size}
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_set_screen_size
|
105
|
+
lcd = Phidgets::TextLCD.new
|
106
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.screen_size = 86}
|
107
|
+
end
|
108
|
+
|
109
|
+
def test_init_screen
|
110
|
+
lcd = Phidgets::TextLCD.new
|
111
|
+
assert_raise(Phidgets::Error::NotAttached) {lcd.init_screen}
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
115
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestPhidgetsTextLED < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_create
|
6
|
+
assert_nothing_raised {Phidgets::TextLED.new}
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_get_row_count
|
10
|
+
led = Phidgets::TextLED.new
|
11
|
+
assert_raise(Phidgets::Error::NotAttached) {led.row_count}
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_get_column_count
|
15
|
+
led = Phidgets::TextLED.new
|
16
|
+
assert_raise(Phidgets::Error::NotAttached) {led.column_count}
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_get_brightness
|
20
|
+
led = Phidgets::TextLED.new
|
21
|
+
assert_raise(Phidgets::Error::NotAttached) {led.brightness}
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_set_brightness
|
25
|
+
led = Phidgets::TextLED.new
|
26
|
+
assert_raise(Phidgets::Error::NotAttached) {led.brightness = 57}
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_set_display_string
|
30
|
+
led = Phidgets::TextLED.new
|
31
|
+
assert_raise(Phidgets::Error::NotAttached) {led.display_string 10, 'Hello'}
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestPhidgetsWeightSensor < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_create
|
6
|
+
assert_nothing_raised {Phidgets::WeightSensor.new}
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_get_weight
|
10
|
+
sensor = Phidgets::WeightSensor.new
|
11
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.weight}
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_get_weight_change_trigger
|
15
|
+
sensor = Phidgets::WeightSensor.new
|
16
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.weight_change_trigger}
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_set_weight_change_trigger
|
20
|
+
sensor = Phidgets::WeightSensor.new
|
21
|
+
assert_raise(Phidgets::Error::NotAttached) {sensor.weight_change_trigger = 2.2}
|
22
|
+
end
|
23
|
+
|
24
|
+
unless RUBY_VERSION < '1.9.0'
|
25
|
+
def test_set_on_weight_change
|
26
|
+
encoder = Phidgets::WeightSensor.new
|
27
|
+
assert_nothing_raised {encoder.on_weight_change {puts 'hello'}}
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
metadata
CHANGED
@@ -1,104 +1,194 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: phidgets
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
|
-
authors:
|
7
|
+
authors:
|
7
8
|
- Craig DeHaan
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
date: 2013-10-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rdoc
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.10'
|
17
22
|
type: :development
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.10'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake-compiler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
27
38
|
type: :development
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
description:
|
36
|
-
|
37
|
-
|
38
|
-
email:
|
39
|
-
-
|
40
|
-
executables:
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
description: Phidgets are a set of "plug and play" building blocks for low cost USB
|
47
|
+
sensing and control from your PC. This gem provides a ruby interface to the phidgets
|
48
|
+
library.
|
49
|
+
email:
|
50
|
+
- cdehaan2@cfl.rr.com
|
51
|
+
executables:
|
41
52
|
- phidget
|
42
|
-
extensions:
|
43
|
-
|
44
|
-
extra_rdoc_files:
|
53
|
+
extensions:
|
54
|
+
- ext/phidgets/extconf.rb
|
55
|
+
extra_rdoc_files:
|
45
56
|
- GNU_GPL.txt
|
46
57
|
- History.txt
|
47
|
-
- Manifest.txt
|
48
|
-
- PostInstall.txt
|
49
|
-
- README.txt
|
50
|
-
files:
|
51
|
-
- GNU_GPL.txt
|
52
|
-
- History.txt
|
53
|
-
- Manifest.txt
|
54
|
-
- PostInstall.txt
|
55
|
-
- README.txt
|
56
58
|
- README.rdoc
|
57
|
-
|
59
|
+
files:
|
58
60
|
- bin/phidget
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
61
|
+
- ext/phidgets/phidgets_motor_control.c
|
62
|
+
- ext/phidgets/phidgets_text_led.c
|
63
|
+
- ext/phidgets/phidgets_servo.c
|
64
|
+
- ext/phidgets/phidgets_common.c
|
65
|
+
- ext/phidgets/phidgets_interface_kit.c
|
66
|
+
- ext/phidgets/phidgets_ir.c
|
67
|
+
- ext/phidgets/phidgets_phsensor.c
|
68
|
+
- ext/phidgets/phidgets_frequency_counter.c
|
69
|
+
- ext/phidgets/phidgets_accelerometer.c
|
70
|
+
- ext/phidgets/phidgets_gps.c
|
71
|
+
- ext/phidgets/phidgets_dictionary.c
|
72
|
+
- ext/phidgets/phidgets_rfid.c
|
73
|
+
- ext/phidgets/phidgets_advanced_servo.c
|
74
|
+
- ext/phidgets/phidgets_bridge.c
|
75
|
+
- ext/phidgets/phidgets_spatial.c
|
76
|
+
- ext/phidgets/phidgets_manager.c
|
77
|
+
- ext/phidgets/phidgets_stepper.c
|
78
|
+
- ext/phidgets/phidgets.c
|
79
|
+
- ext/phidgets/phidgets_encoder.c
|
80
|
+
- ext/phidgets/phidgets_text_lcd.c
|
81
|
+
- ext/phidgets/phidgets_analog.c
|
82
|
+
- ext/phidgets/phidgets_weight_sensor.c
|
83
|
+
- ext/phidgets/phidgets_temp_sensor.c
|
84
|
+
- ext/phidgets/phidgets_led.c
|
85
|
+
- ext/phidgets/phidgets.h
|
86
|
+
- lib/phidgets/stepper.rb
|
87
|
+
- lib/phidgets/encoder.rb
|
88
|
+
- lib/phidgets/frequency_counter.rb
|
89
|
+
- lib/phidgets/bridge.rb
|
90
|
+
- lib/phidgets/ir.rb
|
91
|
+
- lib/phidgets/text_led.rb
|
92
|
+
- lib/phidgets/advanced_servo.rb
|
93
|
+
- lib/phidgets/ph_sensor.rb
|
94
|
+
- lib/phidgets/text_lcd.rb
|
62
95
|
- lib/phidgets/common.rb
|
96
|
+
- lib/phidgets/weight_sensor.rb
|
63
97
|
- lib/phidgets/interfacekit.rb
|
98
|
+
- lib/phidgets/manager.rb
|
64
99
|
- lib/phidgets/rfid.rb
|
100
|
+
- lib/phidgets/motor_control.rb
|
101
|
+
- lib/phidgets/dictionary.rb
|
65
102
|
- lib/phidgets/servo.rb
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
103
|
+
- lib/phidgets/gps.rb
|
104
|
+
- lib/phidgets/spatial.rb
|
105
|
+
- lib/phidgets/temperature_sensor.rb
|
106
|
+
- lib/phidgets/analog.rb
|
107
|
+
- lib/phidgets/accelerometer.rb
|
108
|
+
- lib/phidgets/led.rb
|
109
|
+
- lib/phidgets.rb
|
110
|
+
- test/test_common.rb
|
111
|
+
- test/test_motor_control.rb
|
112
|
+
- test/test_gps.rb
|
113
|
+
- test/test_bridge.rb
|
114
|
+
- test/test_encoder.rb
|
115
|
+
- test/test_led.rb
|
116
|
+
- test/test_stepper.rb
|
69
117
|
- test/test_helper.rb
|
118
|
+
- test/test_analog.rb
|
119
|
+
- test/test_dictionary.rb
|
120
|
+
- test/test_phsensor.rb
|
121
|
+
- test/test_frequency_counter.rb
|
122
|
+
- test/test_servo.rb
|
70
123
|
- test/test_phidgets.rb
|
124
|
+
- test/test_advanced_servo.rb
|
71
125
|
- test/test_interfacekit.rb
|
72
|
-
|
73
|
-
|
126
|
+
- test/test_weight_sensor.rb
|
127
|
+
- test/test_temp_sensor.rb
|
128
|
+
- test/test_ir.rb
|
129
|
+
- test/test_spatial.rb
|
130
|
+
- test/test_rfid.rb
|
131
|
+
- test/test_text_led.rb
|
132
|
+
- test/test_text_lcd.rb
|
133
|
+
- test/test_manager.rb
|
134
|
+
- test/test_accelerometer.rb
|
135
|
+
- Rakefile
|
136
|
+
- GNU_GPL.txt
|
137
|
+
- History.txt
|
138
|
+
- README.rdoc
|
139
|
+
- phidgets.gemspec
|
140
|
+
- ext/phidgets/extconf.rb
|
141
|
+
homepage: https://github.com/csdehaan/phidgets
|
74
142
|
licenses: []
|
75
|
-
|
76
|
-
|
77
|
-
rdoc_options:
|
143
|
+
post_install_message: For more information on phidgets, see http://www.phidgets.com/
|
144
|
+
rdoc_options:
|
78
145
|
- --main
|
79
146
|
- README.rdoc
|
80
|
-
require_paths:
|
147
|
+
require_paths:
|
81
148
|
- lib
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
149
|
+
- ext/phidgets
|
150
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
151
|
+
none: false
|
152
|
+
requirements:
|
153
|
+
- - ! '>='
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
156
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
|
+
none: false
|
158
|
+
requirements:
|
159
|
+
- - ! '>='
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
94
162
|
requirements: []
|
95
|
-
|
96
|
-
|
97
|
-
rubygems_version: 1.3.5
|
163
|
+
rubyforge_project:
|
164
|
+
rubygems_version: 1.8.25
|
98
165
|
signing_key:
|
99
166
|
specification_version: 3
|
100
|
-
summary: Phidgets are a set of "plug and play" building blocks for low cost USB sensing
|
101
|
-
|
102
|
-
|
167
|
+
summary: Phidgets are a set of "plug and play" building blocks for low cost USB sensing
|
168
|
+
and control from your PC. This gem provides a ruby interface to the phidgets library.
|
169
|
+
test_files:
|
170
|
+
- test/test_common.rb
|
171
|
+
- test/test_motor_control.rb
|
172
|
+
- test/test_gps.rb
|
173
|
+
- test/test_bridge.rb
|
174
|
+
- test/test_encoder.rb
|
175
|
+
- test/test_led.rb
|
176
|
+
- test/test_stepper.rb
|
103
177
|
- test/test_helper.rb
|
178
|
+
- test/test_analog.rb
|
179
|
+
- test/test_dictionary.rb
|
180
|
+
- test/test_phsensor.rb
|
181
|
+
- test/test_frequency_counter.rb
|
182
|
+
- test/test_servo.rb
|
183
|
+
- test/test_phidgets.rb
|
184
|
+
- test/test_advanced_servo.rb
|
104
185
|
- test/test_interfacekit.rb
|
186
|
+
- test/test_weight_sensor.rb
|
187
|
+
- test/test_temp_sensor.rb
|
188
|
+
- test/test_ir.rb
|
189
|
+
- test/test_spatial.rb
|
190
|
+
- test/test_rfid.rb
|
191
|
+
- test/test_text_led.rb
|
192
|
+
- test/test_text_lcd.rb
|
193
|
+
- test/test_manager.rb
|
194
|
+
- test/test_accelerometer.rb
|
data/Manifest.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
GNU_GPL.txt
|
2
|
-
History.txt
|
3
|
-
Manifest.txt
|
4
|
-
PostInstall.txt
|
5
|
-
README.txt
|
6
|
-
README.rdoc
|
7
|
-
Rakefile
|
8
|
-
bin/phidget
|
9
|
-
lib/phidgets.rb
|
10
|
-
lib/phidgets/phidgets.rb
|
11
|
-
lib/phidgets/manager.rb
|
12
|
-
lib/phidgets/common.rb
|
13
|
-
lib/phidgets/interfacekit.rb
|
14
|
-
lib/phidgets/rfid.rb
|
15
|
-
lib/phidgets/servo.rb
|
16
|
-
script/console
|
17
|
-
script/destroy
|
18
|
-
script/generate
|
19
|
-
test/test_helper.rb
|
20
|
-
test/test_phidgets.rb
|
21
|
-
test/test_interfacekit.rb
|
data/PostInstall.txt
DELETED
data/README.txt
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
= phidgets
|
2
|
-
|
3
|
-
* http://phidgets.rubyforge.org
|
4
|
-
|
5
|
-
== DESCRIPTION:
|
6
|
-
|
7
|
-
Phidgets are a set of "plug and play" building blocks for low cost USB sensing and control from your PC.
|
8
|
-
This gem provides a ruby interface to the phidgets library.
|
9
|
-
|
10
|
-
== FEATURES/PROBLEMS:
|
11
|
-
|
12
|
-
* This gem uses DL to call the c functions in the Phidgets shared library, so the library must be installed and working.
|
13
|
-
* The gem has been tested to work on both Linux and Windows.
|
14
|
-
* Not all the devices have been implemented, and not all of the devices that have been implemented have been fully tested.
|
15
|
-
* The gem will attempt to guess the name of the phidgets library based on the platform it is run on (Linux, Windows or OS X).
|
16
|
-
If it guesses incorrectly please leave a message to let me know what your platform sets for Config::CONFIG['target_os'] and
|
17
|
-
what is the name of the phidgets library.
|
18
|
-
|
19
|
-
== SYNOPSIS:
|
20
|
-
|
21
|
-
require 'phidgets'
|
22
|
-
|
23
|
-
begin
|
24
|
-
ik = Phidgets::InterfaceKit.new(-1,2000)
|
25
|
-
|
26
|
-
puts "Device Name = #{ik.getDeviceName}"
|
27
|
-
puts "Serial Number = #{ik.getSerialNumber}"
|
28
|
-
puts "Device Version = #{ik.getDeviceVersion}"
|
29
|
-
|
30
|
-
ik.close
|
31
|
-
|
32
|
-
rescue Phidgets::Exception => e
|
33
|
-
puts "Phidgets Error (#{e.code}). #{e}"
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
The gem now installs a command line program that will list all phidgets devices that are attached, as well as allowing any
|
38
|
-
valid method for a given phidget type to be called. For example:
|
39
|
-
|
40
|
-
To list all phidgets attached to the local computer:
|
41
|
-
=> phidget list
|
42
|
-
----------------------------------------------------------------------
|
43
|
-
| SerialNumber | Device Name |
|
44
|
-
----------------------------------------------------------------------
|
45
|
-
| 73723 | Phidget InterfaceKit 0/0/8 |
|
46
|
-
| 88103 | Phidget InterfaceKit 0/0/4 |
|
47
|
-
----------------------------------------------------------------------
|
48
|
-
|
49
|
-
To list all phidgets attached to a remote computer:
|
50
|
-
=> phidget 192.168.100.67 list
|
51
|
-
----------------------------------------------------------------------
|
52
|
-
| SerialNumber | Device Name |
|
53
|
-
----------------------------------------------------------------------
|
54
|
-
| 73782 | Phidget InterfaceKit 0/0/8 |
|
55
|
-
----------------------------------------------------------------------
|
56
|
-
|
57
|
-
To call a method for a specific local phidget:
|
58
|
-
=> phidget 73723 setOutputState 0 1
|
59
|
-
|
60
|
-
To call a method for a specific remote phidget:
|
61
|
-
=> phidget 192.168.100.67:73782 setOuputState 2 0
|
62
|
-
|
63
|
-
== REQUIREMENTS:
|
64
|
-
|
65
|
-
* The Phidgets library (http://www.phidgets.com/)
|
66
|
-
|
67
|
-
== INSTALL:
|
68
|
-
|
69
|
-
* sudo gem install phidgets
|
70
|
-
|
71
|
-
== LICENSE:
|
72
|
-
|
73
|
-
Copyright (C) 2009 Craig DeHaan
|
74
|
-
|
75
|
-
This program is free software; you can redistribute it and/or
|
76
|
-
modify it under the terms of the GNU General Public License
|
77
|
-
as published by the Free Software Foundation; either version 2
|
78
|
-
of the License, or (at your option) any later version.
|
79
|
-
|
80
|
-
This program is distributed in the hope that it will be useful,
|
81
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
82
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
83
|
-
GNU General Public License for more details.
|
84
|
-
|
85
|
-
You should have received a copy of the GNU General Public License
|
86
|
-
along with this program; if not, write to the Free Software
|
87
|
-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|