8 2 Channel USB Relay Module – User Guide
4
adc
adc read x
Reads the analog voltage present at the ADC input mentioned.
X stands for the number of ADC input. The response will be a
number that ranges from 0 – 1023. Please see examples below.
adc read 0
– Reads analog input 0
adc read 4
– Reads analog input 4
5
gpio
gpio set x
Sets the GPIO output status to high. Here x is the number of
the GPIO. Please see examples below.
gpio set 0
– Sets GPIO 0 to high state
gpio set 4
– Sets GPIO 4 to high state
gpio clear x
Sets the GPIO output status to low. Here x is the number of the
GPIO. Please see examples below.
gpio clear 0
– Sets GPIO 0 to low state
gpio clear 4
– Sets GPIO 4 to low state
gpio read x
Reads the digital status present at the input mentioned. Here x
stands for the number of GPIO. The response will be either
“on” or “off” depending on the current digital state of the
GPIO. Please see examples below.
gpio read 0
– Reads GPIO 0 status
gpio read 4
– Reads GPIO 4 status
Controlling relays using Serial Terminal Emulator software
The simple set of ASCII based human readable command set supported by this module makes
controlling relays easy with any off the shelf Serial Terminal Emulation program like Hyper Terminal or
Teraterm. The most important thing to remember here is that since the module appear as a serial
port in the operating system, treat it just like any serial device you may use. Since the underlying
transport is USB not RS232, almost all settings such as baud rate, parity, number of stop bits can be
left to the default values in the software. Flow control needs to be set to “None”. The following
sections give examples of how to use the module with Hyper Terminal and Teraterm.
Using this module with Hyper Terminal is very easy. Please follow the steps below.
•
Connect the module to the computer, install driver and note down the name of the new serial
port that appears in the device manager.
•
Open Hyper Terminal and select the serial port corresponding to the relay module. Click OK.