mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-06-27 20:59:36 +00:00
tested mech
This commit is contained in:
@ -185,6 +185,9 @@ void IR_Home_Process() {
|
||||
break;
|
||||
|
||||
case IR_STOP:
|
||||
speedUP = 100;
|
||||
speedDown = 100;
|
||||
screwSpeed = 0;
|
||||
stopShooting();
|
||||
break;
|
||||
|
||||
|
@ -152,7 +152,8 @@ void setScrewkSpeed(uint8_t speed) {
|
||||
|
||||
//(-v) 0 .. 100(stop) .. 200(+v)
|
||||
void setRollersSpeed(uint8_t up, uint8_t down) {
|
||||
Vz1 = up;
|
||||
|
||||
Vz1 = 200-up; // invert
|
||||
Vz2 = down;
|
||||
}
|
||||
// shot sequence
|
||||
|
@ -148,13 +148,13 @@ int main(void)
|
||||
MX_GPIO_Init();
|
||||
MX_I2C1_Init();
|
||||
MX_USB_DEVICE_Init();
|
||||
MX_USART3_UART_Init();
|
||||
MX_TIM1_Init();
|
||||
MX_TIM2_Init();
|
||||
MX_TIM3_Init();
|
||||
MX_USART3_UART_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1); //PA8
|
||||
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1); //PA8
|
||||
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_2); //PA9
|
||||
|
||||
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1); //PA0
|
||||
@ -193,6 +193,8 @@ initcomlete = 1;
|
||||
|
||||
|
||||
HAL_TIM_IC_Start_IT(&htim3, TIM_CHANNEL_1); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 <20>6 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> PA0 PA1
|
||||
HAL_TIM_IC_Start_IT(&htim3, TIM_CHANNEL_2);
|
||||
|
||||
HAL_TIM_Base_Start_IT(&htim3);
|
||||
HAL_NVIC_EnableIRQ(TIM3_IRQn);
|
||||
|
||||
|
@ -204,7 +204,7 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
||||
*/
|
||||
GPIO_InitStruct.Pin = SPEED_CAPTURE_UP_Pin|SPEED_CAPTURE_DOWN_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/* TIM3 interrupt Init */
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "usbd_cdc_if.h"
|
||||
|
||||
#include "GlobalDefines.h"
|
||||
#include "Print.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
Reference in New Issue
Block a user