steenerson / Plex64

Arduino Library for 64-pin Analog Input Multiplexer Shield
MIT License
1 stars 0 forks source link

This is a C++ library for Arduino, built and tested on version 1.8.10, and based on Arduino's public Test library and 9555 expander examples.

Installation

To install this library, download the .zip file and with Arduino open, go 'Sketch->Include Library->Add .ZIP Library...' and open the downloaded file. Or, just place the extracted library as a subfolder in your Arduino/libraries folder.

When installed, this library should look like:

File/Folder Description
Arduino/libraries/Plex64 This library's folder
Arduino/libraries/Plex64/Plex64.cpp Library implementation file
Arduino/libraries/Plex64/Plex64.h Library description file
Arduino/libraries/Plex64/keywords.txt Syntax coloring file
Arduino/libraries/Plex64/examples Examples in the 'open' menu
Arduino/libraries/Plex64/readme.txt This file

Requirements

The Wire library is required, and is included by the library. Wire is a board-specific library and is installed with most boards. You may need to include Wire.h in your sketch to change certain options such as the I2C clock speed.

Adding to Sketch

To use this library in a sketch, go to the Sketch -> Import Library menu and select Plex64. This will add a corresponding line to the top of your sketch: #include <Plex64.h>

To stop using this library, delete that line from your sketch.

Features

Getting Started

For standard shield-compatible Arduino boards, just plug in the shield, power the Arduino and load one of the library example sketches. The max voltage on any input pin is equal to the Arduino VIN pin or VDD voltage, whichever is higher - do not exceed 5V input when powered by USB, and e.g. measuring 18V inputs requires 18V on the VIN pin. Keep in mind there is a diode drop between the Arduino DC jack and VIN pin, make sure measure with a multimeter!

For detailed hardware info see the wiki.

Usage

Plex64(uint8_t address, uint8_t pinE, uint8_t pinF, uint8_t pinG, uint8_t pinH)

void begin(void);

void setAllChannels(uint8_t input);

void setChannel(uint8_t pin, bool force);

uint16_t readAnalog(uint8_t pin, bool force);

uint16_t getAllChannels(void);

License

This library is licensed under MIT license.