tested mech

This commit is contained in:
2024-09-09 23:19:31 +03:00
parent 400ee6dee0
commit 8aed06aa9c
8 changed files with 19 additions and 8 deletions

View File

@ -185,6 +185,9 @@ void IR_Home_Process() {
break;
case IR_STOP:
speedUP = 100;
speedDown = 100;
screwSpeed = 0;
stopShooting();
break;

View File

@ -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

View File

@ -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);

View File

@ -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 */

View File

@ -29,6 +29,7 @@
#include "usbd_cdc_if.h"
#include "GlobalDefines.h"
#include "Print.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/