How to use Relay on Ltouch43

In our Ltouch43 Android HMI  there are 4 Relays and all the relays are in exchange contact. They have 24Vdc coil and max 5A contact current. All RELAY outputs are high quality relay and protected by varistors, all connectors are removable.

BMTouchGP12 – Relay R2

BMTouchGP13 – Relay R4

BMTouchGP14 – Relay R1

BMTouchGP15 – Relay R3

Before using them we must in the onCreate method :

instantiate the library BMtouch::

  • tmp = BMTouch.LIBsetup(BMTouch.EN12 + BMTouch.EN13 + BMTouch.EN14 + BMTouch.EN15);

Set PIN (GP–) as output, sets the pin (pin) indicated as output and sets its logical level as value::

    • val[0]= 0;
    • BMTouch.GPIOSetupOut(BMTouch.GP12, val[0]);
    • BMTouch.GPIOSetupOut(BMTouch.GP13, val[0]);
    • BMTouch.GPIOSetupOut(BMTouch.GP14, val[0]);
    • BMTouch.GPIOSetupOut(BMTouch.GP15, val[0]);

To switch the output by activating it or not, use this command::

    • tmp=BMTouch.GPIOWrite(BMTouch.GP13, val[0]);

where val [0] corresponds to:

  • 0 relay OFF
  • 1 relay ON

ADB and micro USB for data communication

ADB stands for “Android Debug Bridge” and it basically just allows you to send commands to your device Ltouch.

Download SDK Platform Tools ADB is a small tool bundled in the Android SDK as part of the “Platform Tools.”

ADB stands for “Android Debug Bridge” and it basically just allows you to send commands to your device.

Users used to be required to download the entire SDK (which is very large) just to use ADB, but Google now allows users to download only the Platform Tools.

  • Download the SDK Platform Tools for Windows, Mac, or Linux from https://developer.android.com/studio/releases/platform-tools.html
  • Extract the ZIP file somewhere easily accessible (like C:\platform-tools) We’ve got ADB downloaded on your computer and your Android device is ready to receive instructions.
  • Now it’s time to put it all together and run your first ADB command.
  • Connect your Ltouch to the computer with a USB cable
  • The USB mode must be PTP in order for ADB to work. You can usually change this from the notification shade
  • Make sure to allow USB debugging if a pop-up appears
  • Open the platform-tools folder on your computer
  • Shift+Right Click and select Open command prompt here
  • Type adb devices and hit Enter

That’s all, good work