arduino_firmata 0.0.1 → 0.0.2

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 CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.0.2 2012-10-24
2
+
3
+ * wait until arduino connect.
4
+
1
5
  === 0.0.1 2012-10-24
2
6
 
3
7
  * digital/analog read/write
data/Manifest.txt CHANGED
@@ -8,6 +8,7 @@ Rakefile
8
8
  lib/arduino_firmata.rb
9
9
  lib/arduino_firmata/const.rb
10
10
  lib/arduino_firmata/main.rb
11
+ samples/README.md
11
12
  samples/analog_read_write.rb
12
13
  samples/digital_read.rb
13
14
  samples/led_blink.rb
@@ -5,5 +5,5 @@ require 'arduino_firmata/const'
5
5
  require 'arduino_firmata/main'
6
6
 
7
7
  module ArduinoFirmata
8
- VERSION = '0.0.1'
8
+ VERSION = '0.0.2'
9
9
  end
@@ -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 0 PIN
12
- puts temp = arduino.analog_read(0)*100*5/1024
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.1
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-23 00:00:00.000000000 Z
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: -658418046029011194
132
+ hash: 2762217014466048773
132
133
  required_rubygems_version: !ruby/object:Gem::Requirement
133
134
  none: false
134
135
  requirements: