feat:V1.0 #8

Merged
Clement merged 58 commits from develop into master 2024-02-02 16:03:25 +00:00
3 changed files with 7 additions and 2 deletions
Showing only changes of commit 9c11f62019 - Show all commits

View File

@ -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 ;;;
;;;;;;;;;;;;;;;;;;;;;;

View File

@ -28,6 +28,7 @@ private:
NfcReader *nfcReader;
GRBL *grbl;
BigNfcReader* outputReader;
int grblUpdateTime;
};
#endif

View File

@ -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");
}
}
}