arduino_firmata 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +1 -0
- data/lib/arduino_firmata.rb +1 -1
- data/lib/arduino_firmata/main.rb +7 -1
- data/samples/README.md +1 -0
- data/samples/tweet_temperature.rb +2 -3
- metadata +4 -3
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/lib/arduino_firmata.rb
CHANGED
data/lib/arduino_firmata/main.rb
CHANGED
@@ -20,7 +20,7 @@ module ArduinoFirmata
|
|
20
20
|
@digital_input_data = Array.new(16, 0)
|
21
21
|
@analog_input_data = Array.new(16, 0)
|
22
22
|
|
23
|
-
@version
|
23
|
+
@version = nil
|
24
24
|
|
25
25
|
@serial = SerialPort.new(serial_name, bps, 8, 1, 0)
|
26
26
|
sleep 3
|
@@ -41,6 +41,12 @@ module ArduinoFirmata
|
|
41
41
|
write 1
|
42
42
|
end
|
43
43
|
|
44
|
+
loop do
|
45
|
+
break if @version
|
46
|
+
sleep 0.3
|
47
|
+
end
|
48
|
+
sleep 0.5
|
49
|
+
|
44
50
|
end
|
45
51
|
|
46
52
|
def digital_read(pin)
|
data/samples/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# arduino firmata samples
|
@@ -6,10 +6,9 @@ require 'arduino_firmata'
|
|
6
6
|
require 'tw'
|
7
7
|
|
8
8
|
arduino = ArduinoFirmata::Arduino.new
|
9
|
-
sleep 3
|
10
9
|
|
11
|
-
## LM35DZ -> Analog
|
12
|
-
puts temp = arduino.analog_read(
|
10
|
+
## LM35DZ -> Analog 1 PIN
|
11
|
+
puts temp = arduino.analog_read(1)*100*5/1024
|
13
12
|
client = Tw::Client.new
|
14
13
|
client.auth
|
15
14
|
client.tweet "現在の温度 #{temp}度"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arduino_firmata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
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-10-
|
12
|
+
date: 2012-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: serialport
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- lib/arduino_firmata.rb
|
102
102
|
- lib/arduino_firmata/const.rb
|
103
103
|
- lib/arduino_firmata/main.rb
|
104
|
+
- samples/README.md
|
104
105
|
- samples/analog_read_write.rb
|
105
106
|
- samples/digital_read.rb
|
106
107
|
- samples/led_blink.rb
|
@@ -128,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
128
129
|
version: '0'
|
129
130
|
segments:
|
130
131
|
- 0
|
131
|
-
hash:
|
132
|
+
hash: 2762217014466048773
|
132
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
134
|
none: false
|
134
135
|
requirements:
|