Struct pcf8591::PCF8591 [] [src]

pub struct PCF8591 { /* fields omitted */ }

A struct to handle PCF8591 converter

Allow user to read from given input pin and write to output pin

Methods

impl PCF8591
[src]

Creates a new connection given i2c path and address

  • path: device slave path (0x48 per default)
  • address: has to be defined as per Table 5.
  • v_ref: is the board voltage (e.g. typically 3.3V on raspberry pi)

Reads analog values out of input pin and output digital byte

The conversion with board voltage is left to the user. For automatic conversion, use analog_read

Reads analog values out of input pin and output corresponding input voltage

Returns analog_read_byte * v_ref / 255 (suppose Vagnd == 0)

Writes analog values, as byte, in the output pin

The conversion with board voltage is left to the user For automatic conversion, use analog_write

Writes analog values in the output pin