VMA338
V. 02 – 08/05/2019
4
©Velleman nv
1
D2-D13
2
5 V
3
GND
4
RX (D0)
5
TX (D1)
6
Bluetooth
®
LED
7
Bluetooth
®
communication pin settings, default D0 D1; another RX TX pin
to set the serial port, RX to D3, TX to D2
8
GND
9
5 V
10
A0-A5
11
Bluetooth
®
on-off switch
12
reset button
7.
Example
In this example, we use one VMA338 mounted on the VMA100 (UNO) and a recent Android Smartphone to
communicate with.
Please be aware that BLE (Bluetooth
®
Low Energy) is NOT backward-compatible with the older “Classic”
Bluetooth
®
. For more information please see
https://en.wikipedia.org/wiki/Bluetooth_Low_Energy
Carefully mount the VMA338 onto the VMA100 (UNO), copy-paste the code below into the Arduino
®
IDE (or
download the VMA338_test.zip file from our website).
int val;
int ledpin=13;
void setup()
{
Serial.begin(9600);
pinMode(ledpin,OUTPUT);
} void loop()
{ val=Serial.read();
if(val=='a')
{
digitalWrite(ledpin,HIGH);
delay(250);
digitalWrite(ledpin,LOW);
delay(250);
Serial.println("Velleman VMA338 Bluetooth 4.0 Shield");
}
}
Remove the two RX/TX jumpers from the VMA338 or switch off the HM-10 module (you have to send the code
to the VMA100, not to the VMA338), and compile–upload the code.
Once the upload finished, you can put back the two jumpers or switch on the HM-10.
Now, it is time to prepare the smartphone where we need a Bluetooth
®
terminal to talk and listen to the
VMA338. As mentioned before, BLE 4.0 is NOT compatible with classic Bluetooth
®
so many of the available
Bluetooth
®
terminal apps will NOT work.
or
Install the BleSerialPort app and open it.
You will see a screen like this. Tap on the three dots and select “connect”.