Skip to content

Commit

Permalink
update voltage divider, was reworked
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeferguson committed Jan 2, 2025
1 parent 03cb855 commit 96b4d13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/dyno/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ void SysTick_Handler(void)

// Get system voltage
// adc is 12 bit (4096 count) spread over 3.3V
// voltage divider is 15k/1k
dyno.system_voltage = (ADC1->JDR1 / 4096.0f) * 3.3f * 16.0f;
// voltage divider is 20k/1k
dyno.system_voltage = (ADC1->JDR1 / 4096.0f) * 3.3f * 21.0f;
ADC1->CR2 |= ADC_CR2_JSWSTART;

// Encoder update runs at 250hz
Expand Down

0 comments on commit 96b4d13

Please sign in to comment.