error code ครับ
#include <Password.h>
#include <Keypad.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LCD.h>
#define I2C_ADDR 0x27
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin,BACKLIGHT_PIN,POSITIVE);
LCD *myLCD = &lcd;
Password password = Password("12345678"); // password
int dlugosc = 8; // length of the password
int ledRed = 11;
int ledGreen = 12;
int buzzer = 13;
int ilosc; // number of clicks
const byte ROWS = 4; // rows
const byte COLS = 4; // cols
char keys[ROWS][COLS] =
{
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {5,4,3,2};
byte colPins[COLS] = {9,8,7,6};
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup()
{
Serial.begin(9600);
keypad.addEventListener(keypadEvent);
pinMode(ledRed, OUTPUT);
pinMode(ledGreen, OUTPUT);
pinMode(buzzer, OUTPUT);
digitalWrite(ledRed, HIGH);
digitalWrite(ledGreen, LOW);
lcd.begin(16, 2);
lcd.setCursor(1,0);
lcd.print(" :Welcome:");
lcd.setCursor(0,1);
lcd.print("PLEASE ENTER PIN");
}
void loop()
{
keypad.getKey();
}
void keypadEvent(KeypadEvent eKey)
{
switch (keypad.getState())
{
case PRESSED:
int i;
for( i = 1; i <= 1; i++ )
{
digitalWrite(buzzer, HIGH);
delay(50);
digitalWrite(buzzer, LOW);
delay(50);
}
Serial.print("Pressed: ");
Serial.println(eKey);
switch (eKey)
{
/*
case '#':
break;
case '*':
break;
*/
default:
ilosc=ilosc+1;
password.append(eKey);
}
//Serial.println(ilosc);
if(ilosc == 1)
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("*_");
}
if(ilosc == 2)
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("**_");
}
if(ilosc == 3)
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("***_");
}
if(ilosc == 4)
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("****_");
}
if(ilosc == 5)
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("*****_");
}
if(ilosc == 6)
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("******_");
}
if(ilosc == 7)
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("*******_");
}
if(ilosc == 8)
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("********");
}
if(ilosc == dlugosc)
{
delay(250);
checkPassword();
ilosc = 0;
}
}
}
void checkPassword()
{
if (password.evaluate())
{
int i;
for( i = 1; i <= 2; i++ )
{
digitalWrite(buzzer, HIGH);
delay(70);
digitalWrite(buzzer, LOW);
delay(70);
}
ilosc = 0;
//===============Event that want to do if pin right
Serial.println("Success");
digitalWrite(ledRed, LOW);
digitalWrite(ledGreen, HIGH);
lcd.clear();
lcd.setCursor(0,1);
lcd.print(" << SUCCESS >>");
password.reset();
delay(3000);
digitalWrite(ledRed, LOW);
digitalWrite(ledGreen, LOW);
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" :Welcome:");
lcd.setCursor(0,1);
lcd.print("PLEASE ENTER PIN");
//======================================================
}
else
{
int i;
for( i = 1; i <= 1; i++ )
{
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(200);
}
ilosc = 0;
password.reset();
Serial.println("Wrong");
digitalWrite(ledGreen, LOW);
digitalWrite(ledRed, HIGH);
lcd.clear();
lcd.setCursor(0,1);
lcd.print(" << WRONG >>");
delay(2000);
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" :Welcome:");
lcd.setCursor(0,1);
lcd.print("PLEASE ENTER PIN");
}
}
-----------------------------------------------------------------
ข้อความก่อนจัดรูปแบบ`
อันนี้ที่แจ้งerror ครับ
Arduino: 1.8.19 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\SI2CIO.cpp:210:2: error: #error "ONLY SUPPORTED ON AVR PROCESSORS"
210 | #error "ONLY SUPPORTED ON AVR PROCESSORS"
| ^~~~~
In file included from C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:35:
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp: In member function 'uint8_t LiquidCrystal_SR1W::clearSR()':
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.h:293:78: error: invalid type argument of unary '*' (have 'fio_register' {aka 'unsigned char'})
293 | #define SR1W_ATOMIC_WRITE_LOW(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg &= ~mask; }
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:77:2: note: in expansion of macro 'SR1W_ATOMIC_WRITE_LOW'
77 | SR1W_ATOMIC_WRITE_LOW(srRegister, srMask);
| ^~~~~~~~~~~~~~~~~~~~~
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:86:21: error: invalid type argument of unary '*' (have 'fio_register' {aka 'unsigned char'})
86 | fio_bit reg_val = *srRegister;
| ^~~~~~~~~~~
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:95:4: error: invalid type argument of unary '*' (have 'fio_register' {aka 'unsigned char'})
95 | *srRegister = bit_high;
| ^~~~~~~~~~~
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:96:4: error: invalid type argument of unary '*' (have 'fio_register' {aka 'unsigned char'})
96 | *srRegister = bit_low;
| ^~~~~~~~~~~
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:101:3: error: invalid type argument of unary '*' (have 'fio_register' {aka 'unsigned char'})
101 | *srRegister = bit_high;
| ^~~~~~~~~~~
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp: In member function 'uint8_t LiquidCrystal_SR1W::loadSR(uint8_t)':
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:139:23: error: invalid type argument of unary '*' (have 'fio_register' {aka 'unsigned char'})
139 | fio_bit reg_val = *srRegister;
| ^~~~~~~~~~~
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:144:5: error: invalid type argument of unary '*' (have 'fio_register' {aka 'unsigned char'})
144 | *srRegister = bit_low;
| ^~~~~~~~~~~
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:145:5: error: invalid type argument of unary '*' (have 'fio_register' {aka 'unsigned char'})
145 | *srRegister = bit_high;
| ^~~~~~~~~~~
In file included from C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:35:
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.h:293:78: error: invalid type argument of unary '*' (have 'fio_register' {aka 'unsigned char'})
293 | #define SR1W_ATOMIC_WRITE_LOW(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg &= ~mask; }
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:151:4: note: in expansion of macro 'SR1W_ATOMIC_WRITE_LOW'
151 | SR1W_ATOMIC_WRITE_LOW(srRegister, srMask);
| ^~~~~~~~~~~~~~~~~~~~~
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.h:294:79: error: invalid type argument of unary '*' (have 'fio_register' {aka 'unsigned char'})
294 | #define SR1W_ATOMIC_WRITE_HIGH(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg |= mask; }
C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master\LiquidCrystal_SR1W.cpp:158:4: note: in expansion of macro 'SR1W_ATOMIC_WRITE_HIGH'
158 | SR1W_ATOMIC_WRITE_HIGH(srRegister, srMask);
| ^~~~~~~~~~~~~~~~~~~~~~
Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: C:\Users\krits\Documents\Arduino\libraries\NewLiquidCrystal-master
Not used: C:\Users\krits\Documents\Arduino\libraries\LiquidCrystal_I2C-master
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
Invalid library found in C:\Program Files (x86)\Arduino\libraries\ArduCAM_ESP32S_UNO_PSRAM-master: no headers files (.h) found in C:\Program Files (x86)\Arduino\libraries\ArduCAM_ESP32S_UNO_PSRAM-master
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.