class Digital Input

Read the state of a Digital Input. The idle state of a Digital Input is High due to the pull up resistor on the PCB.

Constructor

class omc048.digital_input(id: integer)

Create a digital input object associated with a digital input.

  • id is the Digital Input number 1 to 2, corresponding to pin 51 and 52.

Methods

digital_input.get()

Returns the digital input state.

  • state is 1 or 0, corresponding to High and Low.

Example

The following example reads the states from the digital inputs.

import omc048

d1 = omc048.digital_input(1)
d2 = omc048.digital_input(2)

d1.get()
d2.get()