Arduino nie widzi biblioteki

Krańcówki, czujniki, oświetlenie...
mcxmcx
Drukarz
Postów w temacie: 4
Posty: 2456
Rejestracja: 09 kwie 2017, 21:32
x 306

Arduino nie widzi biblioteki

Post autor: mcxmcx »

Alo.

Syn mnie chce przebudowac nerf-a, zrobiem srodowisko testowe czyli arduino i programator, ale przy kompilacji programu kiszka wychodzi.

Program ten:
https://github.com/etnom/nerf-select-fire

Biblioteka button dodana, ale przy próbie kompilacji wyrzuca:

Arduino: 1.8.5 (Windows 10), Board: "Arduino Mini, ATmega328P"

nerf-select-fire:36: error: no matching function for call to 'Button::Button(int, bool, bool, int)'

Button trigger (TRIGGER_PIN, PULLUP, INVERT, DEBOUNCE_MS); //trigger button, using the library

I reszta bledow ponizej.

Pytanie: co zepsulem, zwykle przyklady z githuba kompiolowaly sie z reki.

Pzdr

^

C:\Users\Antoni\Downloads\nerf-select-fire-master\nerf-select-fire-master\nerf-select-fire\nerf-select-fire.ino:36:57: note: candidates are:

In file included from C:\Users\Antoni\Downloads\nerf-select-fire-master\nerf-select-fire-master\nerf-select-fire\nerf-select-fire.ino:9:0:

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:14:3: note: Button::Button(uint8_t)

Button(uint8_t pin);

^

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:14:3: note: candidate expects 1 argument, 4 provided

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: constexpr Button::Button(const Button&)

class Button

^

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: candidate expects 1 argument, 4 provided

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: constexpr Button::Button(Button&&)

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: candidate expects 1 argument, 4 provided

nerf-select-fire:37: error: no matching function for call to 'Button::Button(int, bool, bool, int)'

Button dartCountingSwitch (DART_COUNTER_SWITCH_PIN, PULLUP, INVERT, DEBOUNCE_MS); //dart counting button, using the library

^

C:\Users\Antoni\Downloads\nerf-select-fire-master\nerf-select-fire-master\nerf-select-fire\nerf-select-fire.ino:37:80: note: candidates are:

In file included from C:\Users\Antoni\Downloads\nerf-select-fire-master\nerf-select-fire-master\nerf-select-fire\nerf-select-fire.ino:9:0:

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:14:3: note: Button::Button(uint8_t)

Button(uint8_t pin);

^

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:14:3: note: candidate expects 1 argument, 4 provided

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: constexpr Button::Button(const Button&)

class Button

^

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: candidate expects 1 argument, 4 provided

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: constexpr Button::Button(Button&&)

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: candidate expects 1 argument, 4 provided

nerf-select-fire:38: error: no matching function for call to 'Button::Button(int, bool, bool, int)'

Button toggleFireModesBtn (TOGGLE_FIRE_MODES_BTN_PIN, PULLUP, INVERT, DEBOUNCE_MS); //toggle fire modes button, using the librarys

^

C:\Users\Antoni\Downloads\nerf-select-fire-master\nerf-select-fire-master\nerf-select-fire\nerf-select-fire.ino:38:82: note: candidates are:

In file included from C:\Users\Antoni\Downloads\nerf-select-fire-master\nerf-select-fire-master\nerf-select-fire\nerf-select-fire.ino:9:0:

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:14:3: note: Button::Button(uint8_t)

Button(uint8_t pin);

^

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:14:3: note: candidate expects 1 argument, 4 provided

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: constexpr Button::Button(const Button&)

class Button

^

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: candidate expects 1 argument, 4 provided

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: constexpr Button::Button(Button&&)

C:\Users\Antoni\Documents\Arduino\libraries\Button/Button.h:11:7: note: candidate expects 1 argument, 4 provided

C:\Users\Antoni\Downloads\nerf-select-fire-master\nerf-select-fire-master\nerf-select-fire\nerf-select-fire.ino: In function 'void toggleFireModes()':

nerf-select-fire:56: error: 'class Button' has no member named 'wasPressed'

if (toggleFireModesBtn.wasPressed()) { //check if it was pressed

^

C:\Users\Antoni\Downloads\nerf-select-fire-master\nerf-select-fire-master\nerf-select-fire\nerf-select-fire.ino: In function 'void fire()':

nerf-select-fire:67: error: 'class Button' has no member named 'wasPressed'

dartCountingSwitch.wasPressed()) )

^

C:\Users\Antoni\Downloads\nerf-select-fire-master\nerf-select-fire-master\nerf-select-fire\nerf-select-fire.ino: In function 'void checkForDartsFired()':

nerf-select-fire:77: error: 'class Button' has no member named 'isPressed'

} else if (dartCountingSwitch.isPressed() && //if can't fire anymore darts and pusher

^

C:\Users\Antoni\Downloads\nerf-select-fire-master\nerf-select-fire-master\nerf-select-fire\nerf-select-fire.ino: In function 'void selectFire()':

nerf-select-fire:87: error: 'class Button' has no member named 'isPressed'

if (trigger.isPressed()) { //check of trigger is pressed

^

nerf-select-fire:95: error: 'class Button' has no member named 'isPressed'

} else if (!trigger.isPressed()) { //if trigger isn't pressed

^

exit status 1
no matching function for call to 'Button::Button(int, bool, bool, int)'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Jeżeli przypadkiem podam ceny w GBP to sobie kolego, koleżanko, pomnóż razy pięć.
Awatar użytkownika
dziobu
Zasłużony
Postów w temacie: 2
Posty: 8908
Rejestracja: 28 gru 2016, 16:38
Drukarka: ZMorph 2.0(S)
x 5842
Kontakt:

Re: Arduino nie widzi biblioteki

Post autor: dziobu »

Bibliotekę dodałeś pewnie z Arduina, a program korzysta z tej: https://github.com/etnom/Button
Ot "cechy" tego zacnego środowiska ;)

Zmieniłem nazwę biblioteki i klasy z "Button" na "etnom-Button" żeby nie żarło się z biblioteki z Arduina.
Załączniki
nerf-select-fire.rar
(4.21 KiB) Pobrany 184 razy
mcxmcx
Drukarz
Postów w temacie: 4
Posty: 2456
Rejestracja: 09 kwie 2017, 21:32
x 306

Re: Arduino nie widzi biblioteki

Post autor: mcxmcx »

Panie, działa.
Znaczy się kompiluje, teraz beda kabelki ;)


Znaczy skopiowałem ta bibliotekę i zmieniłem nazwe i się kompiluje.

Jak znaleźć info, że to inna biblioteka niż ta z Arduino?
Jeżeli przypadkiem podam ceny w GBP to sobie kolego, koleżanko, pomnóż razy pięć.
Awatar użytkownika
dziobu
Zasłużony
Postów w temacie: 2
Posty: 8908
Rejestracja: 28 gru 2016, 16:38
Drukarka: ZMorph 2.0(S)
x 5842
Kontakt:

Re: Arduino nie widzi biblioteki

Post autor: dziobu »

mcxmcx pisze:Znaczy skopiowałem ta bibliotekę i zmieniłem nazwe i się kompiluje.
No ja Ci tu przygotowałem komplet, bo nazwa biblioteki to raz, nazwa klasy to dwa, a użycie jej w głónym programie to trzy ;)
Pewnie da się to zrobić inaczej, ale to by musiał powiedzieć ktoś kto zna to środowisko.
mcxmcx pisze:Jak znaleźć info, że to inna biblioteka niż ta z Arduino?
Cóż.
Trochę magii, trochę szklanej kuli...

A tak to normalne jest ze to tego typu rozwiązań (jak biblioteki standardowe do róznych środowisk) ludzie robię swoje zamienniki. Tu pewnie chodziło o to żeby oryginalnego Buttona wywalić i zastąpić tym, ale nie znam Arduina i nie wiem jak tam się usuwa biblioteki więc łatwiej było zmienić nazwę.
mcxmcx
Drukarz
Postów w temacie: 4
Posty: 2456
Rejestracja: 09 kwie 2017, 21:32
x 306

Re: Arduino nie widzi biblioteki

Post autor: mcxmcx »

E, pewnie kolega coś ściemnia z tą magia ;)

Dzięki wielkie za pomoc, jeszcze czeka nas zamiana wyjścia na przekaźnik na PWM do ESC (bo będzie bezszczotkowy napędzał całość).
Jeżeli przypadkiem podam ceny w GBP to sobie kolego, koleżanko, pomnóż razy pięć.
Awatar użytkownika
samezrp
Postów w temacie: 1
Posty: 1022
Rejestracja: 29 paź 2016, 15:57
x 66

Re: Arduino nie widzi biblioteki

Post autor: samezrp »

OT: a gdzie browar dla @dziobu?
mcxmcx
Drukarz
Postów w temacie: 4
Posty: 2456
Rejestracja: 09 kwie 2017, 21:32
x 306

Re: RE: Re: Arduino nie widzi biblioteki

Post autor: mcxmcx »

samezrp pisze:OT: a gdzie browar dla @dziobu?
Jak do komputera siądę. Taptalk nie daje.
Jeżeli przypadkiem podam ceny w GBP to sobie kolego, koleżanko, pomnóż razy pięć.
ODPOWIEDZ

Wróć do „Pozostałe”