Config sttep motor pins with #define constants

This commit is contained in:
rafa 2025-05-24 13:57:42 +01:00
parent a5760caad3
commit 1fecdaee61

View File

@ -18,6 +18,10 @@
#define JOYSTICK_Y_PIN A0 #define JOYSTICK_Y_PIN A0
#define BUZZER_PIN 3 #define BUZZER_PIN 3
#define BUTTON_PIN 8 #define BUTTON_PIN 8
#define STEPPER_B_MINUS_PIN 6
#define STEPPER_B_PLUS_PIN 5
#define STEPPER_A_PLUS_PIN 4
#define STEPPER_A_MINUS_PIN 2
#define PARK_SLOTS 3 #define PARK_SLOTS 3
#define STEP_MOTOR_STEPS 200 #define STEP_MOTOR_STEPS 200
@ -31,7 +35,7 @@ LCDScreen screen = LCDScreen();
CarSpotController car_spot_controller = CarSpotController(PARK_SLOTS); CarSpotController car_spot_controller = CarSpotController(PARK_SLOTS);
JoystickController joystick = JoystickController(JOYSTICK_X_PIN, JOYSTICK_Y_PIN); JoystickController joystick = JoystickController(JOYSTICK_X_PIN, JOYSTICK_Y_PIN);
ButtonController button = ButtonController(BUTTON_PIN); ButtonController button = ButtonController(BUTTON_PIN);
Stepper stepper(STEP_MOTOR_STEPS, 6, 5, 4, 2); Stepper stepper(STEP_MOTOR_STEPS, STEPPER_B_MINUS_PIN, STEPPER_B_PLUS_PIN, STEPPER_A_PLUS_PIN, STEPPER_A_MINUS_PIN);
unsigned long current_time, sensor_last_time_readed, barrier_last_time_opened, temperature_last_time_measured, joystick_last_time_activated, joystick_last_time_readed, screen_last_time_updated; unsigned long current_time, sensor_last_time_readed, barrier_last_time_opened, temperature_last_time_measured, joystick_last_time_activated, joystick_last_time_readed, screen_last_time_updated;