Two Bluetooth_HC06 at once with AppInventor. KeyPad 4x4 I2C

Skip to first unread message

Juan Antonio

Jul 18, 2018, 9:26:51 AM7/18/18
Hi friends,

Two Bluetooth HC06 connect at once with App Inventor (Android). Keypad 4x4 I2C. 

0.- Each circuit:
- Arduino.
- Module Bluetooth HC06.
- Keypad 4x4.
- Module I2C to Keypad.

1.- Choose BT1 and/or BT2 by ListPickers


2.- If you know address Mac Bluetooth, connect directly by Buttons.

3.- You can ON/OFF Arduino LED13 of BT1 and/or BT2

4.- If you push a key in keypad of BT1, send a char to Label1
5.- If you push a key in keypad of BT2, send a char to Label2

Arduino code:

/////////////////////////////////////// two_bluetooth.ino ///////////////////////////////////////////////////////

// Juan A. Villalpando

#include <Wire.h>
#include <Keypad_I2C.h>

char val;
#define LED13 13

const byte ROWS = 4; 
const byte COLS = 4; 
char keys[ROWS][COLS] = {
byte rowPins[ROWS] = {0,1,2,3}; 
byte colPins[COLS] = {4,5,6,7};
int i2caddress = 0x27; // Debes cambiar esta dirección por la de tu módulo.
Keypad_I2C kpd = Keypad_I2C( makeKeymap(keys), rowPins, colPins, ROWS, COLS, i2caddress);
void setup(){
  pinMode(LED13, OUTPUT);
void loop(){
// Leer datos.
if( Serial.available() ) {
  val =;
  if( val == '1' )
  { digitalWrite(LED13, HIGH);}
  if( val == '2' )
  { digitalWrite(LED13, LOW);}
// Enviar datos.
  char key = kpd.getKey();
  if (key){
    Serial.print("\n"); // Fin de línea. Importante.

7.- Load this code in each Arduino.

8.- Set you addres i2c module in this line: int i2caddress = 0x27;

9.- What is the i2c address of my module?
With this code you can get i2c address:

10.- Remember:

Clock.TimeInterval = 90 delay(100);


Juan Antonio Villalpando. (Tutorial in Spanish)


Juan Antonio

Jul 20, 2018, 4:46:20 PM7/20/18
to MIT App Inventor Forum
What about Bluetooth audio devices (Speaker, Amplifier, ...), in this case only one device can be connected. 

In this post: 

If you need to connect two audio devices at the same time, you can search the internet: Bluetooth multipoint transmitter

Reply all
Reply to author
0 new messages