Sha256: dd81406661e40c9dc26b618b55577e147f387f6b6fea5e7f0561239cb31453ef
Contents?: true
Size: 380 Bytes
Versions: 2
Compression:
Stored size: 380 Bytes
Contents
require_relative '../lib/frankenpins' # Create a new Pin to control Wiring Pi pin #0 # We enable the built-in pull up/down resistors # on the pin using the :pull => :up option, the # default is :pull => :none raw_pin = Frankenpins::Pin.new(:pin => 0, :pull => :up) raw_pin.watch do |pin| puts "Value changed #{pin.value}" end puts raw_pin puts "Waiting...." Frankenpins.wait
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
frankenpins-0.3.0 | examples/raw_pin.rb |
frankenpins-0.2.1 | examples/raw_pin.rb |