Page 22 - MDP2022-2
P. 22

String  hexString  =  "";
            char  uid_1,  uid_2,  uid_3,  uid_4,  uid_5,  uid_6,  uid_7,  uid_8;


            int  reset_flag  =  0;


            SoftwareSerial  mySerial(10,  11);
            WiFiServer  server(80);
            WiFiClient  client;
            HTTPClient  http;
            LiquidCrystal_I2C  lcd(0x27,  16,  2);


            void  I2C_mega_TX()  {
                Serial.println("난  보냈어~");
                Wire.beginTransmission(Slave_mega);
                Wire.write(0x88);
                Wire.write(0);//수동/자동
                Wire.endTransmission();
            }


            void  I2C_ADD2_communication()  {
                Wire.requestFrom(Slave_mega,  8);
                hexString  =  "";
                uid_1  =  Wire.read();
                hexString  +=  String(uid_1);
                uid_2  =  Wire.read();
                hexString  +=  String(uid_2);
                uid_3  =  Wire.read();
                hexString  +=  String(uid_3);
                uid_4  =  Wire.read();
                hexString  +=  String(uid_4);
                uid_5  =  Wire.read();
                hexString  +=  String(uid_5);
                uid_6  =  Wire.read();
                hexString  +=  String(uid_6);
                uid_7  =  Wire.read();
                hexString  +=  String(uid_7);
                uid_8  =  Wire.read();
                hexString  +=  String(uid_8);
                Serial.print("받아온  UID값:  ");
                Serial.println(hexString);
            }


            void  NFC_check()  {
                I2C_ADD2_communication();
   17   18   19   20   21   22   23   24   25   26   27