arduino_mega 0.1.0 → 0.1.1
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/lib/arduino_mega.rb +10 -1
- metadata +1 -1
data/lib/arduino_mega.rb
CHANGED
@@ -14,6 +14,8 @@ require "serialport"
|
|
14
14
|
|
15
15
|
class Arduino
|
16
16
|
|
17
|
+
@serial = nil
|
18
|
+
|
17
19
|
# initialize port and baudrate
|
18
20
|
def initialize(port, baudrate=115200)
|
19
21
|
puts "initialized"
|
@@ -160,11 +162,18 @@ class ArduinoMega < Arduino
|
|
160
162
|
def initialize(args=[])
|
161
163
|
super(*args)
|
162
164
|
output(13) # declare output pins
|
165
|
+
if block_given? then
|
166
|
+
yield(self)
|
167
|
+
close()
|
168
|
+
end
|
163
169
|
end
|
164
170
|
|
165
171
|
def p13h=(bflag)
|
166
172
|
send (bflag == true ? :set_high : :set_low), 13
|
167
173
|
end
|
168
|
-
|
174
|
+
|
175
|
+
def to_s()
|
176
|
+
end
|
177
|
+
|
169
178
|
end
|
170
179
|
|