Waveshare 8ch Relay Board Example
A simple repository containing (functioning) examples of how to use the Waveshare 8ch relay board.
|
This repository contains example code useful when using the WaveShare 8-channel relay module for the RaspberryPi. The example code provided by WaveShare is mixed up and doesn't work correctly.
Contained within this repository is a Bash script, which handles setting the GPIO pins, respective to the selected channel. There are a total of eight relays on the board, which are designated as "channels".
The script takes two arguments:
The channel may be prefixed with "ch" or "CH", or may simply be passed to the script. The order in which the arguments are passed does not affect the execution of the script.
If the –help|-h arg is passed, the script will print the help text and exit.
Provided with this repository is a simple sample application written in C++, providing the same functionality as the Bash script.
The C++ example provides the same features/functionality and arguments as the Bash script.
They are virtually 1:1 ports of each other.