add idée d'algo
This commit is contained in:
parent
b7fe429508
commit
d8f0bb07be
@ -1,9 +1,11 @@
|
||||
#ifndef PROGRAM_H
|
||||
#define PROGRAM_H
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "DolibarrClient.h"
|
||||
#include "GRBL.h"
|
||||
#include <Arduino.h>
|
||||
#include <M5Stack.h>
|
||||
#include <vector>
|
||||
|
||||
class Program {
|
||||
public:
|
||||
@ -16,8 +18,21 @@ public:
|
||||
* Program WarehouseGUI loop
|
||||
*/
|
||||
void loop();
|
||||
|
||||
private:
|
||||
|
||||
DolibarrClient *client;
|
||||
|
||||
/**
|
||||
* @brief stepper motor controller
|
||||
*/
|
||||
GRBL* grbl;
|
||||
|
||||
/**
|
||||
* @brief stack des UUID lue
|
||||
*
|
||||
*/
|
||||
std::vector<String>* NfcIDs;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -21,9 +21,59 @@ Program::Program() {
|
||||
struct DolibarrConfig dolibarr = {DOLIBARR_URL, DOLIBARR_API_TOKEN};
|
||||
initialize_wifi(wifi_c);
|
||||
this->client = new DolibarrClient(dolibarr);
|
||||
|
||||
// initialisation GRBL
|
||||
this->grbl = new GRBL(STEPMOTOR_I2C_ADDR);
|
||||
Wire.begin(21, 22);
|
||||
grbl->init(STEPER_SPEED, STEPER_PAS, STEPER_ACC);
|
||||
}
|
||||
|
||||
void Program::loop() {
|
||||
if(this->grbl->)
|
||||
this->grbl->mouveForward(5); //TODO: réglé pour qu'il avance de la bonne distance
|
||||
String nfcIn = "0"; // TODO: si le lecteur envoie qqc
|
||||
//TODO: refrech servo
|
||||
if(nfcIn !="0"){
|
||||
//envoyer sur dolibard
|
||||
this->NfcIDs->push_back(nfcIn);
|
||||
}
|
||||
if(this->NfcIDs->size() > 0){
|
||||
|
||||
}
|
||||
|
||||
//alog V1
|
||||
//je lis la valeur NFC
|
||||
//si qqc
|
||||
//je demande a dolibard ou j'envoie
|
||||
//j'envoie au servo la commande
|
||||
//j'avance le moteur jusqu'a X (a definir)
|
||||
//si rien j'avance le moteur (5mm)
|
||||
|
||||
|
||||
//idée algo v1.5 (ajou petite gestion d'erreur)
|
||||
//alog V1
|
||||
//je lis la valeur NFC
|
||||
//si qqc
|
||||
//je demande a dolibard ou j'envoie
|
||||
//j'envoie au servo la commande
|
||||
//j'avance le moteur jusqu'a X (a definir)
|
||||
//si rien j'avance le moteur (5mm)
|
||||
//si le lecteur de sortie voi pas de colis
|
||||
//on affiche une erreur de colis non lue
|
||||
//si un seul colis
|
||||
//on dit que le colis est bien trié (avec porte de sortie)
|
||||
//si il y a 2 colis (ou plus)
|
||||
//on affiche une erreur de bourrage
|
||||
|
||||
|
||||
|
||||
//idée algo v2
|
||||
//utiliser une pile
|
||||
//utiliser le 2nd lecteur pour vidé la pile
|
||||
//gestion d'erreur complete avec celle du dessus plus celle de la pile
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user