Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.03 KB

README.md

File metadata and controls

28 lines (22 loc) · 1.03 KB

MuxMate

16 channel (de-)multiplexer library for electric imp. Tested with Texas Instrument's CD4067BE analog multiplexer.

Usage

Constructor takes 5 arguments in which the control and signal pins for the multiplexer are defined (controlpin1, controlpin2, controlpin3, controlpin4, signalpin). Optionally a 6th boolean argument can be provided to configure as de-multiplexer (true) or default multiplexer (false).

mux <- MuxMate(hardware.pin1, hardware.pin2, hardware.pin5, hardware.pin7, hardware.pin9);

Use the read() method for reading the multiplexer pins if configured as multiplexer. Provide channel number (0-15) to be read as argument. In this example reading channel 10.

local value = mux.read(10);

Use the write() method for writing a value to a channel on the multiplexer. Provide channel number (0-15) and value to be written as arguments.

mux.write(10, 1);

Circuit

Connecting the multiplexer to an Electric Imp Card