Sha256: bb206036ab85440746387ea2993881008d3ae8078dcea2d0cddbb31b26f307e7

Contents?: true

Size: 314 Bytes

Versions: 2

Compression:

Stored size: 314 Bytes

Contents

require 'bundler/setup'
require 'wiringpi2'

INPUT = 0
PUD_UP = 2
INT_EDGE_BOTH = 3

pin = 0

io = WiringPi::GPIO.new
io.pin_mode(pin,INPUT)
io.pullUpDnControl(pin, PUD_UP)
io.wiringpi_isr(pin, INT_EDGE_BOTH) do
  puts "in block"
end

puts "before while"

while (true)
  puts io.digital_read(pin)
  sleep(0.5)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
frankenpins-0.3.0 scratch/interrupt.rb
frankenpins-0.2.1 scratch/interrupt.rb