Robot secondaire
Dependencies: RoboClaw mbed StepperMotor
Fork of RoboClaw by
Diff: main.cpp
- Revision:
- 58:02dc8328975a
- Parent:
- 54:be4ea8da9057
- Child:
- 64:24e1057a97f7
- Child:
- 71:5590dbe8393a
--- a/main.cpp Wed May 04 16:27:51 2016 +0000 +++ b/main.cpp Wed May 04 19:55:03 2016 +0000 @@ -1,6 +1,8 @@ #include "func.h" #include "map.h" +#include "ControlleurPince.h" + /* Déclaration des différents éléments de l'IHM */ DigitalIn CAMP(PA_15); @@ -32,9 +34,9 @@ AnalogIn capt4(PC_0); /* Moteurs pas à pas */ -Stepper RMot(NC, PA_8, PC_7, 4); -Stepper ZMot(NC, PB_4, PB_10, 5); -Stepper LMot(NC, PB_5, PB_3, 4); +Stepper RMot(NC, PA_8, PC_7, PB_15, 4); +Stepper ZMot(NC, PB_4, PB_10, PB_14, 5); +Stepper LMot(NC, PB_5, PB_3, PB_13, 4); /* Fins de course */ InterruptIn EndR(PB_15); InterruptIn EndZ(PB_14); @@ -43,6 +45,8 @@ DigitalIn EnZ(PB_14); DigitalIn EnL(PB_13); +ControlleurPince controlleurPince(RMot, ZMot, LMot, EnR, EnZ, EnL); + Ticker ticker; //Serial logger(USBTX, USBRX); Serial logger(PA_2, PA_3); @@ -58,8 +62,19 @@ /* Debut du programme */ int main(void) { - logger.printf("Depart homologation !\n\r"); - homologation(); + //logger.printf("Depart homologation !\n\r"); + //homologation(); + logger.printf("Homming ...\n\r"); + controlleurPince.home(); + wait(1); + controlleurPince.setPos(10.f,0.f,0.f); + wait(1); + controlleurPince.setPos(20.f,0.f,0.f); + wait(1); + controlleurPince.setPos(70.f,0.f,0.f); + wait(1); + controlleurPince.setPos(20.f,0.f,0.f); + logger.printf("Done ...\n\r"); /*drapeau = 0; init();