Buongiorno a tutti,
dato che sto preparando uno sketch gigante volevo suddividerlo in più schede ma quando arrivo a compilare l'ide mi dice:
Arduino:1.6.3 (Windows 7), Scheda:"Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
In file included from button_peri.ino:3:0:
funzioni.h: In function 'void readButtons()':
funzioni.h:4:3: error: 'byte' was not declared in this scope
byte reading;
^
funzioni.h:4:8: error: expected ';' before 'reading'
byte reading;
^
funzioni.h:5:8: error: expected ';' before 'buttonEnterState'
byte buttonEnterState=true; // the current reading from the Enter input pin
^
funzioni.h:6:8: error: expected ';' before 'buttonEscState'
byte buttonEscState=true; // the current reading from the input pin
^
funzioni.h:7:8: error: expected ';' before 'buttonLeftState'
byte buttonLeftState=true; // the current reading from the input pin
^
funzioni.h:8:8: error: expected ';' before 'buttonRightState'
byte buttonRightState=true; // the current reading from the input pin
^
funzioni.h:10:3: error: 'reading' was not declared in this scope
reading = digitalRead(buttonPinEnter);
^
funzioni.h:10:39: error: 'digitalRead' was not declared in this scope
reading = digitalRead(buttonPinEnter);
ecc ecc
eppure se io butto tutto nella pagina principale funziona. Non so se ho fatto qualche errore concettuale (ma non credo) per cui metto anche la cartella dello sketch zippato.
PS è un programma da finire e servirà per gestire un menu da display.
PPS OT
Sono stato via per lungo tempo perchè ho fatto dei passi da gigante nella gestione di uno stepper, a breve vorrei aprire un topic in cui spiego come gestire uno stepper di tipo NEMA 34 con due schede BTS7960 con implementata la stall detection! Credo di aver fatto una cosa abbastanza ganza ![]()
button_peri.zip (2.36 KB)