Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. #include <NewSoftSerial.h>
  2. #include <ESP8266WiFi.h>
  3. #include <WiFiClientSecure.h>
  4. #include <FPC1020.h>
  5.  
  6.  
  7. extern unsigned char l_ucFPID;
  8. extern unsigned char rBuf[192]; //Receive return data
  9. #define sw_serial_rx_pin 2 // Connect this pin to TX on the FPC1020
  10. #define sw_serial_tx_pin 3 // Connect this pin to RX on the FPC1020
  11.  
  12. const char* ssid = "-------";
  13. const char* password = "-------";
  14.  
  15. const char* host = "-------";
  16. String url = "-------?id=";
  17.  
  18. NewSoftSerial swSerial(sw_serial_rx_pin, sw_serial_tx_pin); // Fingerprint serial (RX, TX)
  19. FPC1020 Finger(&swSerial);
  20.  
  21. void setup() {
  22. Serial.begin(115200);
  23. Serial.print("connecting to ");
  24. Serial.println(ssid);
  25. WiFi.begin(ssid, password);
  26. while (WiFi.status() != WL_CONNECTED) {
  27. delay(500);
  28. Serial.print(".");
  29. }
  30.  
  31. pinMode(4, INPUT);
  32. }
  33.  
  34. void loop() {
  35. Serial.println("Please put your finger on the Sensor.");
  36. while(Serial.available()<=0);
  37.  
  38. if( Finger.Search()){
  39. Serial.print("Success, your User ID is: ");
  40. url = "-------?id=" + l_ucFPID;
  41. Serial.println( l_ucFPID, DEC);
  42.  
  43. WiFiClient client;
  44. if (!client.connect(host, 80)) {
  45. Serial.println("connection failed");
  46. return;
  47. }
  48.  
  49. client.print(String("GET ") + url + " HTTP/1.1rn" +
  50. "Host: " + host + "rn" +
  51. "User-Agent: BuildFailureDetectorESP8266rn" +
  52. "Connection: closernrn");
  53.  
  54. String line = "";
  55. while (client.connected()) {
  56. line = client.readString();
  57. }
  58.  
  59. Serial.println(line);
  60.  
  61. }
  62. else {
  63. Serial.println("Failed, please try again.");
  64. }
  65. }
  66.  
  67. C:Program Files (x86)ArduinolibrariesNewSoftSerialNewSoftSerial.cpp:41:27: fatal error: avr/interrupt.h: No such file or directory
  68.  
  69. #include <avr/interrupt.h>
  70. ^
  71. compilation terminated.
  72.  
  73. exit status 1
  74. Error compiling for board WeMos D1 R2 & mini.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement