Table of Contents

Digital


These functions provide access to digital pins.


Digital Read

Read the current value of a digital pin.

  • Digital.Read(pin, pull)
    pin: Pin number
    pull: Sets the internal pull resistors: 'None', 'PullUp', 'PullDown'
    Returns: True = high or false = low

This example will read current value on pin 2.

x = duelink.Digital.Read(2, 'PullUp')
print(x)

Digital Write

Sets a pin's digital output.

  • Digital.Write(pin, state)
    pin: Pin number
    state: True = high or false = low

This example will set pin 2 to be High.

duelink.Digital.Write(2, True)