quentin godbert
/
t2-stm32-lift
interrupt géré compil ok sans isr
Fork of T2_STM32 by
Diff: main.cpp
- Revision:
- 5:d6484db1ec5c
- Parent:
- 2:ab0ccf9bb38c
- Child:
- 6:6291f032e996
diff -r b01a3ce6ef01 -r d6484db1ec5c main.cpp --- a/main.cpp Sun Jan 14 17:39:09 2018 +0000 +++ b/main.cpp Mon Feb 05 08:10:13 2018 +0000 @@ -2,41 +2,19 @@ // Modification dans variant.h de la variable PWM_FREQUENCY afin de changer la fréquence par défaut du PWM -//#include "StepperMotor.h" // Classe Moteur pas à pas -#include "Cylinder.h" -#include "Carriage.h" -#include "Lift.h" // Classe Ascenseur -#include "Config.h" // Bibliothéque Configuration +#include "config.h" // Bibliothéque Configuration +#include "lift.h" // Classe Ascenseur +#include "pwm.h" + +Lift Lift(Lift_StepPin, Lift_DirPin, Lift_CurrentSensor); //Appel de l'objet ascenseur -unsigned char Carriage_CurrentPos = 1, - Lift_CurrentPos = 1, - RxdBuffer[2], // Déclaration Buffer de réception - ActualAdress = 0, - Address = 0, - Command = 0, - Check_serial_is_OK, - State = 0; -int Sequence = 0, - i = 0, - j = 0; -unsigned long CurrentMillis; // Variable millis -bool test = true; +Serial.begin(115200); // Port série pour communication avec Raspberry -Lift Lift(Lift_pinUp, Lift_pinDown, Lift_UpSensor, Lift_MiddleSensor); //Appel de l'objet ascenseur -Cylinder Cylinder(Cylinder_OriginSensor, Cylinder_StepPin, Cylinder_DirPin, Cylinder_EnablePin, Cylinder_PosMin, Cylinder_PosMax); //Appel de l'objet barillet -Carriage Carriage(Carriage_OriginSensor, Carriage_StepPin, Carriage_DirPin, Carriage_EnablePin, Carriage_PosMin, Carriage_PosMax); //Appel de l'objet chariot - -void setup() { - - Serial.begin(115200); // Port série pour communication avec Raspberry - - pinMode(Carriage_OriginSensor, INPUT_PULLUP); - pinMode(Buzzer_Output, OUTPUT); - pinMode(Cylinder_EnablePin, INPUT); - digitalWrite(Cylinder_DirPin, LOW); - Cylinder.Origin(Cylinder_OriginSensor); - -} +pinMode(Carriage_OriginSensor, INPUT_PULLUP); +pinMode(Buzzer_Output, OUTPUT); +pinMode(Cylinder_EnablePin, INPUT); +digitalWrite(Cylinder_DirPin, LOW); +Cylinder.Origin(Cylinder_OriginSensor); void loop() {