error rc522 with Nodemcu v1.0 (esp826612E)
Posted: Thu Mar 02, 2017 5:50 am
Hi
I want change this code add some thins , for example add Serial.print function but every time I got error
!
thank you
I want change this code add some thins , for example add Serial.print function but every time I got error
!
Code: Select all
#include <SPI.h>
#include <MFRC522.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <DNSServer.h>
#include <WiFiManager.h>
WiFiClient client;
ESP8266WebServer server(80);
String Argument_Name, Clients_Response1, Clients_Response2;
#define SS_PIN D4
#define RST_PIN D2
MFRC522 rfid(SS_PIN, RST_PIN);
void printHex(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? " 0" : "");
Serial.print(buffer[i], HEX);}
}
void HandleClient() {
server.send(200, "text/html", "test page");
}
void setup() {
Serial.begin(115200);
SPI.begin();
rfid.PCD_Init();
WiFiManager wifiManager;
wifiManager.setTimeout(180);
if (!wifiManager.autoConnect("ESP8266_AP")) {
Serial.println("failed to connect and timeout occurred");
delay(3000);
ESP.reset(); //reset and try again
delay(5000);
}
Serial.println("WiFi connected..");
server.begin(); Serial.println("Webserver started...");
Serial.print("Use this URL to connect: http://");
Serial.print(WiFi.localIP()); Serial.println("/");
Serial.println("teette");
server.on("/", HandleClient);
Serial.print("errorrrrr"); \\got error this line
}
void loop() {
server.handleClient();
if (!rfid.PICC_IsNewCardPresent()) return;
if (!rfid.PICC_ReadCardSerial()) return;
printHex(rfid.uid.uidByte, rfid.uid.size);
Serial.println();
rfid.PICC_HaltA();
Serial.print("errorrrrr"); \\or this one
}
thank you