GY-63_MS5611/libraries/74HC138
2024-02-23 14:27:13 +01:00
..
.github 0.1.0 74HC138 2024-02-23 14:27:13 +01:00
examples 0.1.0 74HC138 2024-02-23 14:27:13 +01:00
test 0.1.0 74HC138 2024-02-23 14:27:13 +01:00
.arduino-ci.yml 0.1.0 74HC138 2024-02-23 14:27:13 +01:00
74HC138.h 0.1.0 74HC138 2024-02-23 14:27:13 +01:00
CHANGELOG.md 0.1.0 74HC138 2024-02-23 14:27:13 +01:00
keywords.txt 0.1.0 74HC138 2024-02-23 14:27:13 +01:00
library.json 0.1.0 74HC138 2024-02-23 14:27:13 +01:00
library.properties 0.1.0 74HC138 2024-02-23 14:27:13 +01:00
LICENSE 0.1.0 74HC138 2024-02-23 14:27:13 +01:00
README.md 0.1.0 74HC138 2024-02-23 14:27:13 +01:00

Arduino CI Arduino-lint JSON check GitHub issues

License: MIT GitHub release PlatformIO Registry

74HC138

Arduino library for the 74HC138 3-to-8 line decoder/demultiplexer.

Description

This library controls the 74HC138 3 to 8 line decoder. With 3 IO lines one can select one of 8 output lines.

Interface

#include "74HC138.h"

Constructor

  • 74HC138(uint8_t pin0, uint8_t pin1, uint8_t pin2, uint8_t pinEnable = 255) set the 3 selection IO lines from pin numbers. Optionally set the enable pin, connect to E1 or E2, see datasheet.
  • 74HC138(uint8_t * pins, uint8_t pinEnable = 255) set the 3 selection IO lines from an array. The pins array should have at least 3 elements. Optionally set the enable pin, connect to E1 or E2, see datasheet.

Select line

  • bool setLine(uint8_t line) set line 0 .. 7. Returns false if out of range.
  • uint8_t getLine() returns 0 .. 7
  • void nextLine() selects the next line, wraps back to 0 is needed.
  • void prevLine() selects the previous line, wraps to 7 is needed.

Enable

Works only if enable line is set in constructor.

  • void enable() enables output / selection.
  • void disable() disables output / selection.
  • bool isEnabled() checks if line is enabled.

Future

Must

  • improve documentation
  • get hardware to test

Should

Could

Wont

Support

If you appreciate my libraries, you can support the development and maintenance. Improve the quality of the libraries by providing issues and Pull Requests, or donate through PayPal or GitHub sponsors.

Thank you,