Files
gobot/stone-dispencer-control/firmware-stone-dispencer/src/headSystem/stoneDispencer.cpp
2025-01-12 00:16:00 +01:00

19 lines
426 B
C++

#include "headSystem.hpp"
#include "FreeRTOS.h"
#include "task.h"
STONE_STATE HeadSystem::dropSequence() {
gpio_put(LED1_PIN, 1);
if(!preLoad()) {
this->stoneState = EMPTY;
return this->stoneState;
}
bool prev_head_state = headUp;
setHeadUp(false);
STONE_STATE res = dropStone();
setHeadUp(prev_head_state);
this->stoneState = res;
gpio_put(LED2_PIN, 0);
return res;
}