Académique Documents
Professionnel Documents
Culture Documents
2021/2022
Plan
I- Introduction
VI- Montage
V- Schéma de câblage
VII- CODE
2
I-Introduction
4
III- L’application RemoteXY
L’application RemoteXY est un moyen facile de
créer et d'utiliser une interface utilisateur
graphique mobile pour les cartes
contrôleurs à contrôler via un smartphone
ou une tablette.
5
VI- Montage
V- Schéma de câblage
7
VI- Interface sur Smartphone android
VI- CODE
#define REMOTEXY_MODE__ESP8266_SOFTSERIAL_POINT
#include <SoftwareSerial.h>
#include <RemoteXY.h>
// input variables
uint8_t switch_1; // =1 if switch ON and =0 if OFF
uint8_t switch_2; // =1 if switch ON and =0 if OFF
uint8_t switch_3; // =1 if switch ON and =0 if OFF
uint8_t switch_4; // =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_1 2
#define PIN_SWITCH_2 3
#define PIN_SWITCH_3 4
#define PIN_SWITCH_4 5
void setup()
{
RemoteXY_Init ();
pinMode (PIN_SWITCH_1, OUTPUT);
pinMode (PIN_SWITCH_2, OUTPUT);
pinMode (PIN_SWITCH_3, OUTPUT);
pinMode (PIN_SWITCH_4, OUTPUT);
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_2, (RemoteXY.switch_2==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_3, (RemoteXY.switch_3==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_4, (RemoteXY.switch_4==0)?LOW:HIGH);
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay()
}