Struct wiringpi::pin::InputPin
[−]
[src]
pub struct InputPin<Pin>(_, _);
Methods
impl<P: Pin> InputPin<P>
[src]
pub fn new(pin: c_int) -> InputPin<P>
[src]
pub fn number(&self) -> c_int
[src]
pub fn digital_read(&self) -> Value
[src]
This function returns the value read at the given pin.
It will be High
or Low
(1 or 0) depending on the logic level at the pin.
pub fn analog_read(&self) -> u16
[src]
This returns the value read on the supplied analog input pin. You will need to register additional analog modules to enable this function for devices such as the Gertboard, quick2Wire analog board, etc.
impl<P: Pin + RequiresRoot> InputPin<P>
[src]
pub fn pull_up_dn_control(&self, pud: Pull)
[src]
This sets the pull-up or pull-down resistor mode on the given pin.
Unlike the Arduino, the BCM2835 has both pull-up an down internal
resistors. The parameter pud should be; Off
, (no pull up/down),
Down
(pull to ground) or Up
(pull to 3.3v)