Topic: HC-05
hello everyone,
im new here and i just learned about this app.
i am using and arduino uno with HC-05. they have to control 9 relays.
when i use 1 switch button relay 1 switches, but when i use 2 switch buttons all 9 relay's switch. anyone knows what could be the problem here?
lots of thanks for the one who can help me solve the problem!!
code:
/*
-- gip bluetooth --
This source code of graphical user interface
has been generated automatically by RemoteXY editor.
To compile this code using RemoteXY library 3.1.13 or later version
download by link http://remotexy.com/en/library/
To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
- for ANDROID 4.13.13 or later version;
- for iOS 1.10.3 or later version;
This source code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
*/
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// you can enable debug logging to Serial at 115200
//#define REMOTEXY__DEBUGLOG
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600
#include <RemoteXY.h>
// RemoteXY GUI configuration
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] = // 172 bytes
{ 255,9,0,0,0,165,0,17,0,0,0,16,1,106,200,1,1,9,0,2,
3,8,44,22,0,2,26,16,16,79,78,0,79,70,70,0,2,56,9,44,
22,0,2,26,31,31,79,78,0,79,70,70,0,2,5,45,44,22,0,2,
26,31,31,79,78,0,79,70,70,0,2,56,46,44,22,0,2,26,31,31,
79,78,0,79,70,70,0,2,6,84,44,22,0,2,26,31,31,79,78,0,
79,70,70,0,2,57,84,44,22,0,2,26,31,31,79,78,0,79,70,70,
0,2,7,114,44,22,0,2,26,31,31,79,78,0,79,70,70,0,2,56,
117,44,22,0,2,26,31,31,79,78,0,79,70,70,0,2,29,156,44,22,
0,2,26,31,31,79,78,0,79,70,70,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t switch_01; // =1 if switch ON and =0 if OFF
uint8_t switch_02; // =1 if switch ON and =0 if OFF
uint8_t switch_03; // =1 if switch ON and =0 if OFF
uint8_t switch_04; // =1 if switch ON and =0 if OFF
uint8_t switch_05; // =1 if switch ON and =0 if OFF
uint8_t switch_06; // =1 if switch ON and =0 if OFF
uint8_t switch_07; // =1 if switch ON and =0 if OFF
uint8_t switch_08; // =1 if switch ON and =0 if OFF
uint8_t switch_09; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#define PIN_SWITCH_01 0
#define PIN_SWITCH_02 1
#define PIN_SWITCH_03 4
#define PIN_SWITCH_04 5
#define PIN_SWITCH_05 6
#define PIN_SWITCH_06 7
#define PIN_SWITCH_07 8
#define PIN_SWITCH_08 9
#define PIN_SWITCH_09 10
void setup()
{
RemoteXY_Init ();
pinMode (PIN_SWITCH_01, OUTPUT);
pinMode (PIN_SWITCH_02, OUTPUT);
pinMode (PIN_SWITCH_03, OUTPUT);
pinMode (PIN_SWITCH_04, OUTPUT);
pinMode (PIN_SWITCH_05, OUTPUT);
pinMode (PIN_SWITCH_06, OUTPUT);
pinMode (PIN_SWITCH_07, OUTPUT);
pinMode (PIN_SWITCH_08, OUTPUT);
pinMode (PIN_SWITCH_09, OUTPUT);
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(PIN_SWITCH_01, (RemoteXY.switch_01==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_02, (RemoteXY.switch_02==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_03, (RemoteXY.switch_03==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_04, (RemoteXY.switch_04==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_05, (RemoteXY.switch_05==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_06, (RemoteXY.switch_06==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_07, (RemoteXY.switch_07==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_08, (RemoteXY.switch_08==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_09, (RemoteXY.switch_09==0)?LOW:HIGH);
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay(), use instead RemoteXY_delay()
}