ADD: analog input for vehicle during hackerhotel
This commit is contained in:
parent
ff224a2509
commit
8d31eaf8af
|
@ -171,8 +171,12 @@ void DMA1_Channel1_IRQHandler() {
|
|||
if(adccmd2 - 700 > 0){
|
||||
pwmrl -= adccmd2 - 700;
|
||||
}
|
||||
pwml = -pwmrl/4;
|
||||
pwmr = pwmrl/4;
|
||||
|
||||
pwmrl = powf((pwmrl/4), 3) / 614125;
|
||||
pwml = -pwmrl;
|
||||
pwmr = pwmrl;
|
||||
|
||||
|
||||
|
||||
if(ABS((adc_buffer.dcl - offsetdcl) * MOTOR_AMP_CONV_DC_AMP) > DC_CUR_LIMIT || timeout > 50 || enable == 0) {
|
||||
LEFT_TIM->BDTR &= ~TIM_BDTR_MOE;
|
||||
|
|
|
@ -132,6 +132,7 @@ int main(void) {
|
|||
|
||||
if (HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN)) {
|
||||
enable = 0;
|
||||
while (HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN)) {}
|
||||
for (int i = 0; i < 8; i++) {
|
||||
buzzerFreq = i;
|
||||
HAL_Delay(100);
|
||||
|
|
2080
build/hover.hex
2080
build/hover.hex
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue