samples/tweet_temperature.rb in arduino_firmata-0.0.1 vs samples/tweet_temperature.rb in arduino_firmata-0.0.2
- old
+ new
@@ -4,12 +4,11 @@
$:.unshift File.expand_path '../lib', File.dirname(__FILE__)
require 'arduino_firmata'
require 'tw'
arduino = ArduinoFirmata::Arduino.new
-sleep 3
-## LM35DZ -> Analog 0 PIN
-puts temp = arduino.analog_read(0)*100*5/1024
+## LM35DZ -> Analog 1 PIN
+puts temp = arduino.analog_read(1)*100*5/1024
client = Tw::Client.new
client.auth
client.tweet "現在の温度 #{temp}度"