Skip to content

Can't read correct values from a rpi B 1 #79

@jvalrog

Description

@jvalrog

I'm using pin 4 (gpio 4) with this simple code:

require "pi_piper"

pin = PiPiper::Pin.new(:pin => 4, :direction => :in)

loop do
        puts pin.value
        sleep 0.1
end

I use a jumper and connect it to gpio4 and 3.3V (top-left).

It always shows a 0. If I change the jumper to GND (bottom-left), I also get a 0.

Reading the values from /sys/..., it shows correctly a 1 or 0, but the pi_piper script will always show a 0.

What's wrong? (I'm using pi_piper 2.0)

See the attached screenshot
2016-07-31-140056_1920x1080_scrot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions