-
Notifications
You must be signed in to change notification settings - Fork 4
Feeder #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feeder #11
Conversation
|
pene |
|
Intenta compilar, eso te va generar un par de errores |
| #define HEADLIGHT_PIN GPIO_PIN_0 | ||
| #define MOTOR_PWM_PIN GPIO_PIN_1 | ||
|
|
||
| void pwm_init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Está padre que se haga con registros directo... Pero recuerda que por cuestiones de modularidad, usamos los tim handlers del STM32
Ocupa esos, jeje
| TIM2->CR1 |= TIM_CR1_CEN; | ||
| } | ||
|
|
||
| void set_motor_speed(uint8_t duty_cycle) { TIM2->CCR2 = duty_cycle; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esto también debería de ser a través del handler
| gpio_init(); | ||
| pwm_init(); | ||
|
|
||
| osThreadDef(THREAD_1, motor_control_task, osPriorityNormal, 0, configMINIMAL_STACK_SIZE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esto está bien, sólo faltaría condicionar para que con el semaphore, se prenda y se apaque 👀
No description provided.