feat/output-reader #20
@ -23,6 +23,7 @@ build_flags =
|
||||
;-D STEPER_PAS=755.906 ; = 65mm
|
||||
-D STEPER_PAS=58 ; = 5mm
|
||||
-D STEPER_SPEED=2700 ;1000 ; 2500
|
||||
-D GRBL_UPDATE=165 ;update time in ms
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; App config ;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -28,6 +28,7 @@ private:
|
||||
NfcReader *nfcReader;
|
||||
GRBL *grbl;
|
||||
BigNfcReader* outputReader;
|
||||
int grblUpdateTime;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -82,6 +82,7 @@ Program::Program() {
|
||||
this->grbl = new GRBL(STEPMOTOR_I2C_ADDR);
|
||||
this->outputReader = new BigNfcReader();
|
||||
this->outputReader->init();
|
||||
this->grblUpdateTime = 0;
|
||||
Wire.begin(21, 22);
|
||||
grbl->init(STEPER_SPEED, STEPER_PAS, STEPER_ACC);
|
||||
struct WifiConfig wifi_c = {WIFI_SSID, WIFI_PASSWORD};
|
||||
@ -100,7 +101,7 @@ void Program::loop() {
|
||||
}
|
||||
this->servo->refresh();
|
||||
this->outputReader->refresh();
|
||||
Serial.println(this->outputReader->getNbTags());
|
||||
// Serial.println(this->outputReader->getNbTags());
|
||||
|
||||
if(this->outputReader->getNbTags() >= 2){
|
||||
lcdScreen->set_nfc_message("To mutch colis number detected");
|
||||
@ -162,8 +163,10 @@ void Program::loop() {
|
||||
}
|
||||
this->grbl->mouveForward(CONVOYER_LEN);
|
||||
} else {
|
||||
if(this->grbl->isIddle()){
|
||||
if(this->grbl->isIddle() || (maintenant - this->grblUpdateTime >= GRBL_UPDATE)){
|
||||
this->grblUpdateTime = maintenant;
|
||||
this->grbl->mouveForward(5);
|
||||
Serial.print("pouet");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user