اطلاعیه

Collapse
No announcement yet.

مشکل در آپلود برنامه روی آردوینو

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    مشکل در آپلود برنامه روی آردوینو

    سلام
    من قراره با کیپد،LCD و ماژول رله،یه همچین قفلی درست کنم
    مشکل اینه که در زمان آپلود،خطا میده و آپلود نمیشه
    حالا از شما درخواست دارم تا نگاهی به این بندازید و مشکل رو رفع کنید
    کد:
    #include <Password.h>#include <LiquidCrystal_I2C.h>
    #include <Keypad.h>


    //Most common adresses PCF8574 = 0x20, PCF8574A = 0x38,PCF8574AT = 0x3F
    //PCF8574T = 0x27
    #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


    int buzzer = 3;
    int relay = 9;
    const int buttonPin = 5;
    int buttonState = 0;
    Password password = Password( "1654" );
    const byte ROWS = 4; // Four rows
    const byte COLS = 4; // Four columns
    // Define the Keymap
    char keys[ROWS][COLS] = {
    {'1','2','3','A',},
    {'4','5','6','B',},
    {'7','8','9','C',},
    {'*','0','#','D',}
    };
    // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
    byte rowPins[ROWS] = {
    12, 13, A5, A4}; //connect to the row pinouts of the keypad
    byte colPins[COLS] = {
    A3, A2, A1, A0};


    // Create the Keypad
    Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );




    void setup(){
    pinMode(buttonPin, INPUT);
    pinMode(relay, OUTPUT);
    pinMode(buzzer, OUTPUT);
    lcd.begin (16,2);
    digitalWrite(relay, HIGH);
    lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
    lcd.setBacklight(HIGH);
    lcd.print(" BlueCore Tech ");
    lcd.setCursor(0,1);
    lcd.print(" Acces Control ");

    delay(5000);

    lcd.clear();
    lcd.print("Acces Code: ");
    Serial.begin(9600);
    keypad.addEventListener(keypadEvent);
    keypad.setDebounceTime(100);
    }


    void loop(){
    keypad.getKey();
    buttonState = digitalRead(buttonPin);
    if (buttonState == HIGH) {
    lcd.clear();
    }
    }


    void keypadEvent(KeypadEvent eKey){
    switch (keypad.getState()){
    case PRESSED:


    digitalWrite(buzzer, HIGH);
    delay(100);
    digitalWrite(buzzer, LOW);
    switch (eKey){
    case 'A': guessPassword(); break;
    lcd.print("*");
    default:
    password.append(eKey);
    }
    }
    }


    void guessPassword(){
    LiquidCrystal_I2C
    lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
    if (password.evaluate()){
    digitalWrite(relay, LOW);
    lcd.setCursor(0,0);
    lcd.print("##CORRECT CODE##");
    lcd.setCursor(4,1);
    lcd.print("WELCOME!");
    delay(10000);
    digitalWrite(relay, HIGH);
    password.reset();
    lcd.clear();
    lcd.print("Acces Code: ");

    }




    else{
    digitalWrite(relay, HIGH);
    lcd.setCursor(0,0);
    lcd.print("###WRONG CODE###");
    password.reset();
    lcd.setCursor(2,1);
    lcd.print("ACCES DENIED");
    delay(3000);
    lcd.clear();
    lcd.print("Acces Code: ");
    }
    }


    خطا:
    Arduino: 1.8.15 (Windows 8.1), Board: "Arduino Uno"











    D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino: In function 'void setup()':


    FMDF75LIOKBSZ60:52:5: error: 'lcd' was not declared in this scope


    lcd.begin (16,2);


    ^~~


    FMDF75LIOKBSZ60:54:39: error: 'POSITIVE' was not declared in this scope


    lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);


    ^~~~~~~~


    D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino: In function 'void loop()':


    FMDF75LIOKBSZ60:73:5: error: 'lcd' was not declared in this scope


    lcd.clear();


    ^~~


    D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino: In function 'void keypadEvent(KeypadEvent)':


    FMDF75LIOKBSZ60:86:5: error: 'lcd' was not declared in this scope


    lcd.print("*");


    ^~~


    D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino: In function 'void guessPassword()':


    FMDF75LIOKBSZ60:95:65: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'


    lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);


    ^


    In file included from D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino:9:0:


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:57:3: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)


    LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows);


    ^~~~~~~~~~~~~~~~~


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:57:3: note: candidate expects 3 arguments, 8 provided


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)


    class LiquidCrystal_I2C : public Print {


    ^~~~~~~~~~~~~~~~~


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&)


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided


    exit status 1


    'lcd' was not declared in this scope






    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.



    #2
    پاسخ : مشکل در آپلود برنامه روی آردوینو

    نوشته اصلی توسط S.Malaki نمایش پست ها
    سلام
    من قراره با کیپد،LCD و ماژول رله،یه همچین قفلی درست کنم
    مشکل اینه که در زمان آپلود،خطا میده و آپلود نمیشه
    حالا از شما درخواست دارم تا نگاهی به این بندازید و مشکل رو رفع کنید
    کد:
    #include <Password.h>#include <LiquidCrystal_I2C.h>
    #include <Keypad.h>


    //Most common adresses PCF8574 = 0x20, PCF8574A = 0x38,PCF8574AT = 0x3F
    //PCF8574T = 0x27
    #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


    int buzzer = 3;
    int relay = 9;
    const int buttonPin = 5;
    int buttonState = 0;
    Password password = Password( "1654" );
    const byte ROWS = 4; // Four rows
    const byte COLS = 4; // Four columns
    // Define the Keymap
    char keys[ROWS][COLS] = {
    {'1','2','3','A',},
    {'4','5','6','B',},
    {'7','8','9','C',},
    {'*','0','#','D',}
    };
    // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
    byte rowPins[ROWS] = {
    12, 13, A5, A4}; //connect to the row pinouts of the keypad
    byte colPins[COLS] = {
    A3, A2, A1, A0};


    // Create the Keypad
    Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );




    void setup(){
    pinMode(buttonPin, INPUT);
    pinMode(relay, OUTPUT);
    pinMode(buzzer, OUTPUT);
    lcd.begin (16,2);
    digitalWrite(relay, HIGH);
    lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
    lcd.setBacklight(HIGH);
    lcd.print(" BlueCore Tech ");
    lcd.setCursor(0,1);
    lcd.print(" Acces Control ");

    delay(5000);

    lcd.clear();
    lcd.print("Acces Code: ");
    Serial.begin(9600);
    keypad.addEventListener(keypadEvent);
    keypad.setDebounceTime(100);
    }


    void loop(){
    keypad.getKey();
    buttonState = digitalRead(buttonPin);
    if (buttonState == HIGH) {
    lcd.clear();
    }
    }


    void keypadEvent(KeypadEvent eKey){
    switch (keypad.getState()){
    case PRESSED:


    digitalWrite(buzzer, HIGH);
    delay(100);
    digitalWrite(buzzer, LOW);
    switch (eKey){
    case 'A': guessPassword(); break;
    lcd.print("*");
    default:
    password.append(eKey);
    }
    }
    }


    void guessPassword(){
    LiquidCrystal_I2C
    lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
    if (password.evaluate()){
    digitalWrite(relay, LOW);
    lcd.setCursor(0,0);
    lcd.print("##CORRECT CODE##");
    lcd.setCursor(4,1);
    lcd.print("WELCOME!");
    delay(10000);
    digitalWrite(relay, HIGH);
    password.reset();
    lcd.clear();
    lcd.print("Acces Code: ");

    }




    else{
    digitalWrite(relay, HIGH);
    lcd.setCursor(0,0);
    lcd.print("###WRONG CODE###");
    password.reset();
    lcd.setCursor(2,1);
    lcd.print("ACCES DENIED");
    delay(3000);
    lcd.clear();
    lcd.print("Acces Code: ");
    }
    }


    خطا:
    Arduino: 1.8.15 (Windows 8.1), Board: "Arduino Uno"











    D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino: In function 'void setup()':


    FMDF75LIOKBSZ60:52:5: error: 'lcd' was not declared in this scope


    lcd.begin (16,2);


    ^~~


    FMDF75LIOKBSZ60:54:39: error: 'POSITIVE' was not declared in this scope


    lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);


    ^~~~~~~~


    D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino: In function 'void loop()':


    FMDF75LIOKBSZ60:73:5: error: 'lcd' was not declared in this scope


    lcd.clear();


    ^~~


    D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino: In function 'void keypadEvent(KeypadEvent)':


    FMDF75LIOKBSZ60:86:5: error: 'lcd' was not declared in this scope


    lcd.print("*");


    ^~~


    D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino: In function 'void guessPassword()':


    FMDF75LIOKBSZ60:95:65: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'


    lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);


    ^


    In file included from D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino:9:0:


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:57:3: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)


    LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows);


    ^~~~~~~~~~~~~~~~~


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:57:3: note: candidate expects 3 arguments, 8 provided


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)


    class LiquidCrystal_I2C : public Print {


    ^~~~~~~~~~~~~~~~~


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&)


    F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided


    exit status 1


    'lcd' was not declared in this scope






    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.


    سلام
    شما از آبجکت lcd توی نقاط مختلف برنامه استفاده کردید ولی این آبجکت رو در تابع guessPassword تعریفش کردید که در دسترس بقیه برنامه نیست. برای درست شدنش باید تعریفشو منتقل کنید یه جایی که توی همه نقاط در دسترس باشه؛ مثلا منتقلش کنید به خط ۴۱ این کدی که بالا گذاشتید.

    دیدگاه


      #3
      پاسخ : مشکل در آپلود برنامه روی آردوینو

      خیلی ممنون از جوابتون
      واقعیتش من اصلا برنامه نویسی نمی دونم و از برنامه رو هم از اینجا برداشتم
      اگه ممکنه لطف کنید و تغییرات رو انجام بدبد
      جدیدترین ویرایش توسط S.Malaki; ۱۳:۳۱ ۱۴۰۰/۱۰/۲۰.

      دیدگاه


        #4
        پاسخ : مشکل در آپلود برنامه روی آردوینو

        نوشته اصلی توسط S.Malaki نمایش پست ها
        خیلی ممنون از جوابتون
        واقعیتش من اصلا برنامه نویسی نمی دونم و از برنامه رو هم از اینجا برداشتم
        اگه ممکنه لطف کنید و تغییرات رو انجام بدبد
        خط ۹۵ و ۹۶ رو به ۴۱ منتقل کنید.

        دیدگاه


          #5
          پاسخ : مشکل در آپلود برنامه روی آردوینو

          چنین خطایی داد
          expected constructor, destructor, or type conversion before '(' token

          دیدگاه


            #6
            پاسخ : مشکل در آپلود برنامه روی آردوینو

            نوشته اصلی توسط S.Malaki نمایش پست ها
            چنین خطایی داد
            expected constructor, destructor, or type conversion before '(' token
            این خطا رو به چه خطی میده؟
            این کد رو تست کنید:

            #include <Password.h>
            #include <LiquidCrystal_I2C.h>
            #include <Keypad.h>


            // Most common adresses PCF8574 = 0x20, PCF8574A = 0x38,PCF8574AT = 0x3F
            // PCF8574T = 0x27
            #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


            int buzzer = 3;
            int relay = 9;
            const int buttonPin = 5;
            int buttonState = 0;
            Password password = Password("1654");
            const byte ROWS = 4; // Four rows
            const byte COLS = 4; // Four columns
            // Define the Keymap
            char keys[ROWS][COLS] =
            {
            {'1','2','3','A',},
            {'4','5','6','B',},
            {'7','8','9','C',},
            {'*','0','#','D',}
            };
            // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
            byte rowPins[ROWS] = {12, 13, A5, A4}; // connect to the row pinouts of the keypad
            byte colPins[COLS] = {A3, A2, A1, A0};


            // Create the Keypad
            Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);


            // LCD
            LiquidCrystal_I2C lcd = LiquidCrystal_I2C(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin);


            void setup()
            {
            pinMode(buttonPin, INPUT);
            pinMode(relay, OUTPUT);
            pinMode(buzzer, OUTPUT);
            lcd.begin(16, 2);
            digitalWrite(relay, HIGH);
            lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);
            lcd.setBacklight(HIGH);
            lcd.print(" BlueCore Tech ");
            lcd.setCursor(0, 1);
            lcd.print(" Acces Control ");


            delay(5000);


            lcd.clear();
            lcd.print("Acces Code: ");
            Serial.begin(9600);
            keypad.addEventListener(keypadEvent);
            keypad.setDebounceTime(100);
            }


            void loop()
            {
            keypad.getKey();
            buttonState = digitalRead(buttonPin);
            if (buttonState == HIGH)
            {
            lcd.clear();
            }
            }


            void keypadEvent(KeypadEvent eKey)
            {
            switch (keypad.getState())
            {
            case PRESSED:


            digitalWrite(buzzer, HIGH);
            delay(100);
            digitalWrite(buzzer, LOW);
            switch (eKey)
            {
            case 'A':
            guessPassword();
            break;
            lcd.print("*");
            default:
            password.append(eKey);
            }
            }
            }


            void guessPassword()
            {
            if (password.evaluate())
            {
            digitalWrite(relay, LOW);
            lcd.setCursor(0, 0);
            lcd.print("##CORRECT CODE##");
            lcd.setCursor(4, 1);
            lcd.print("WELCOME!");
            delay(10000);
            digitalWrite(relay, HIGH);
            password.reset();
            lcd.clear();
            lcd.print("Acces Code: ");
            }


            else
            {
            digitalWrite(relay, HIGH);
            lcd.setCursor(0, 0);
            lcd.print("###WRONG CODE###");
            password.reset();
            lcd.setCursor(2, 1);
            lcd.print("ACCES DENIED");
            delay(3000);
            lcd.clear();
            lcd.print("Acces Code: ");
            }
            }
            جدیدترین ویرایش توسط hossein.m98; ۱۵:۰۵ ۱۴۰۰/۱۰/۲۰.

            دیدگاه


              #7
              پاسخ : مشکل در آپلود برنامه روی آردوینو

              خیلی ازتون ممنونم که وقت گذاشتید
              حالا با برنامه شما تست کردم و این خطا رو میده

              Arduino: 1.8.15 (Windows 8.1), Board: "Arduino Uno"

              FMDF75LIOKBSZ60:44:107: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'


              LiquidCrystal_I2C lcd = LiquidCrystal_I2C(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin);


              ^


              In file included from D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino:2:0:


              F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:57:3: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)


              LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows);


              ^~~~~~~~~~~~~~~~~


              F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:57:3: note: candidate expects 3 arguments, 8 provided


              F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)


              class LiquidCrystal_I2C : public Print {


              ^~~~~~~~~~~~~~~~~


              F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided


              F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&)


              F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided


              D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino: In function 'void setup()':


              FMDF75LIOKBSZ60:54:7: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'; did you mean 'setBacklight'?


              lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);


              ^~~~~~~~~~~~~~~


              setBacklight


              FMDF75LIOKBSZ60:54:38: error: 'POSITIVE' was not declared in this scope


              lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);


              ^~~~~~~~


              exit status 1


              no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'


              Invalid library found in F:\Arduino\libraries\arduino: no headers files (.h) found in F:\Arduino\libraries\arduino


              Invalid library found in F:\Arduino\libraries\emonTxFirmware: no headers files (.h) found in F:\Arduino\libraries\emonTxFirmware


              Invalid library found in F:\Arduino\libraries\OneWire: no headers files (.h) found in F:\Arduino\libraries\OneWire


              Invalid library found in F:\Arduino\libraries\RFM12B_Simple: no headers files (.h) found in F:\Arduino\libraries\RFM12B_Simple


              Invalid library found in F:\Arduino\libraries\arduino: no headers files (.h) found in F:\Arduino\libraries\arduino


              Invalid library found in F:\Arduino\libraries\emonTxFirmware: no headers files (.h) found in F:\Arduino\libraries\emonTxFirmware


              Invalid library found in F:\Arduino\libraries\OneWire: no headers files (.h) found in F:\Arduino\libraries\OneWire


              Invalid library found in F:\Arduino\libraries\RFM12B_Simple: no headers files (.h) found in F:\Arduino\libraries\RFM12B_Simple






              This report would have more information with
              "Show verbose output during compilation"
              option enabled in File -> Preferences.


              جدیدترین ویرایش توسط S.Malaki; ۱۵:۳۳ ۱۴۰۰/۱۰/۲۰.

              دیدگاه


                #8
                پاسخ : مشکل در آپلود برنامه روی آردوینو

                نوشته اصلی توسط S.Malaki نمایش پست ها
                خیلی ازتون ممنونم که وقت گذاشتید
                حالا با برنامه شما تست کردم و این خطا رو میده

                Arduino: 1.8.15 (Windows 8.1), Board: "Arduino Uno"

                FMDF75LIOKBSZ60:44:107: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'


                LiquidCrystal_I2C lcd = LiquidCrystal_I2C(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin);


                ^


                In file included from D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino:2:0:


                F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:57:3: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)


                LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows);


                ^~~~~~~~~~~~~~~~~


                F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:57:3: note: candidate expects 3 arguments, 8 provided


                F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)


                class LiquidCrystal_I2C : public Print {


                ^~~~~~~~~~~~~~~~~


                F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided


                F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&)


                F:\Arduino\libraries\LiquidCrystal_I2C-master/LiquidCrystal_I2C.h:55:7: note: candidate expects 1 argument, 8 provided


                D:\Electronic\Arduino\Project\LCD_kepad_reley\FMDF75LIOKBSZ60\FMDF75LIOKBSZ60.ino: In function 'void setup()':


                FMDF75LIOKBSZ60:54:7: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'; did you mean 'setBacklight'?


                lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);


                ^~~~~~~~~~~~~~~


                setBacklight


                FMDF75LIOKBSZ60:54:38: error: 'POSITIVE' was not declared in this scope


                lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);


                ^~~~~~~~


                exit status 1


                no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'


                Invalid library found in F:\Arduino\libraries\arduino: no headers files (.h) found in F:\Arduino\libraries\arduino


                Invalid library found in F:\Arduino\libraries\emonTxFirmware: no headers files (.h) found in F:\Arduino\libraries\emonTxFirmware


                Invalid library found in F:\Arduino\libraries\OneWire: no headers files (.h) found in F:\Arduino\libraries\OneWire


                Invalid library found in F:\Arduino\libraries\RFM12B_Simple: no headers files (.h) found in F:\Arduino\libraries\RFM12B_Simple


                Invalid library found in F:\Arduino\libraries\arduino: no headers files (.h) found in F:\Arduino\libraries\arduino


                Invalid library found in F:\Arduino\libraries\emonTxFirmware: no headers files (.h) found in F:\Arduino\libraries\emonTxFirmware


                Invalid library found in F:\Arduino\libraries\OneWire: no headers files (.h) found in F:\Arduino\libraries\OneWire


                Invalid library found in F:\Arduino\libraries\RFM12B_Simple: no headers files (.h) found in F:\Arduino\libraries\RFM12B_Simple






                This report would have more information with
                "Show verbose output during compilation"
                option enabled in File -> Preferences.


                دوست عزیز از اینجا به بعدش دیگه مشکل از قواعد زبان CPP نیست که من بتونم کمکتون کنم. کد رو از هر کجا که برداشتید، احتمالا غلطه، یا شاید از ورژن*های خاصی از کتابخونه ها استفاده میکنه که شما استفاده نمیکنید. مثلا توی ارور اول داره میگه فراخوانی LiquidCrystal_I2C به اون شکل که باید نیست؛ یعنی مشکلی توی تعداد و نوع آرگومان ها وجود داره.
                بهتره یا دنبال یک پروژه دیگه باشید، یا ببینید همین پروژه از چه ورژن هایی استفاده کرده و شما هم دقیقا از همونا استفاده کنید.

                دیدگاه


                  #9
                  پاسخ : مشکل در آپلود برنامه روی آردوینو

                  سلام مجدد
                  بازم اومدم با یه دردسر جدید
                  این کد:
                  #include <Wire.h> #include <LiquidCrystal_I2C.h>
                  #include <Keypad.h>


                  #define Password_Length 8


                  int signalPin = 12;


                  char Data[Password_Length];
                  char Master[Password_Length] = "123A456";
                  byte data_count = 0, master_count = 0;
                  bool Pass_is_good;
                  char customKey;


                  const byte ROWS = 4;
                  const byte COLS = 4;


                  char hexaKeys[ROWS][COLS] = {
                  {'1', '2', '3', 'A'},
                  {'4', '5', '6', 'B'},
                  {'7', '8', '9', 'C'},
                  {'*', '0', '#', 'D'}
                  };


                  byte rowPins[ROWS] = {9, 8, 7, 6};
                  byte colPins[COLS] = {5, 4, 3, 2};


                  Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);


                  LiquidCrystal_I2C lcd(0x27, 16, 2);


                  void setup(){
                  lcd.init();
                  lcd.backlight();
                  pinMode(signalPin, OUTPUT);
                  }


                  void loop(){


                  lcd.setCursor(0,0);
                  lcd.print("Enter Password:");


                  customKey = customKeypad.getKey();
                  if (customKey){
                  Data[data_count] = customKey;
                  lcd.setCursor(data_count,1);
                  lcd.print(Data[data_count]);
                  data_count++;
                  }


                  if(data_count == Password_Length-1){
                  lcd.clear();


                  if(!strcmp(Data, Master)){
                  lcd.print("Correct");
                  digitalWrite(signalPin, HIGH);
                  delay(5000);
                  digitalWrite(signalPin, LOW);
                  }
                  else{
                  lcd.print("Incorrect");
                  delay(1000);
                  }

                  lcd.clear();
                  clearData();
                  }
                  }


                  void clearData(){
                  while(data_count !=0){
                  Data[data_count--] = 0;
                  }
                  return;
                  }


                  و این خطا رو میده:
                  Arduino: 1.8.15 (Windows 8.1), Board: "Arduino Uno"









































                  F:\Arduino\libraries\Keypad\utility\Key.cpp: In constructor 'Key::Key(char)':


                  F:\Arduino\libraries\Keypad\utility\Key.cpp:43:2: error: 'kcode' was not declared in this scope


                  kcode = -1;


                  ^~~~~


                  F:\Arduino\libraries\Keypad\utility\Key.cpp: At global scope:


                  F:\Arduino\libraries\Keypad\utility\Key.cpp:49:79: error: no 'void Key::key_update(char, KeyState, boolean)' member function declared in class 'Key'


                  void Key::key_update (char userKeyChar, KeyState userState, boolean userStatus) {


                  ^


                  exit status 1


                  Error compiling for board Arduino Uno.






                  This report would have more information with
                  "Show verbose output during compilation"
                  option enabled in File -> Preferences.



                  بی زحمت اگه بشه عیوب این کد رو هم بگید
                  جدیدترین ویرایش توسط S.Malaki; ۱۸:۲۸ ۱۴۰۰/۱۰/۲۰.

                  دیدگاه


                    #10
                    پاسخ : مشکل در آپلود برنامه روی آردوینو

                    درود

                    این کد رو تست کنید :

                    دیدگاه


                      #11
                      پاسخ : مشکل در آپلود برنامه روی آردوینو

                      سلام
                      متاسفانه چنین اروری میده
                      Error compiling for board Arduino Uno.

                      دیدگاه


                        #12
                        پاسخ : مشکل در آپلود برنامه روی آردوینو

                        نوشته اصلی توسط S.Malaki نمایش پست ها
                        سلام
                        متاسفانه چنین اروری میده
                        Error compiling for board Arduino Uno.
                        کد موجود در لینک https://electropedia.ir/code/61dc4fbfe849f رو روی آردوینو Uno تست گرفتم بدون مشکل اپلود شد

                        دیدگاه


                          #13
                          پاسخ : مشکل در آپلود برنامه روی آردوینو

                          نوشته اصلی توسط electropedia نمایش پست ها
                          کد موجود در لینک https://electropedia.ir/code/61dc4fbfe849f رو روی آردوینو Uno تست گرفتم بدون مشکل اپلود شد
                          بله یه چند تا کد دیگه رو تست کردم اما همین ارور رو داد،حذفش کردم دوباره نصب کنم.

                          دیدگاه


                            #14
                            پاسخ : مشکل در آپلود برنامه روی آردوینو

                            از آقای hossein.m98 و electropedia بابت وقتی که گذاشتن،ممنونم
                            برنامه آردوینو رو یه بار کامل حذف و نصبش کردم و درست شد.

                            دیدگاه

                            لطفا صبر کنید...
                            X