frustrated
This commit is contained in:
@@ -126,12 +126,12 @@ main(void)
|
||||
HAL_ADC_PollForConversion(&hadc1, 100); //poll ADC1 periph, timeout 100ms
|
||||
|
||||
rawValue = HAL_ADC_GetValue(&hadc1);
|
||||
printf("The value is %hu volts.\r\n", rawValue);
|
||||
printf("ADC raw value: %hu\r\n", rawValue);
|
||||
|
||||
HAL_Delay(500);
|
||||
|
||||
volts = ((float)rawValue / 4096) * 3; // convert to voltage from 0 to 3.0
|
||||
printf("The value is %f volts.\r\n", volts);
|
||||
printf("Voltage: %fV\r\n", volts);
|
||||
|
||||
HAL_Delay(500);
|
||||
|
||||
@@ -139,7 +139,7 @@ main(void)
|
||||
|
||||
__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, duty);
|
||||
|
||||
HAL_Delay(100);
|
||||
HAL_Delay(500);
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
|
||||
Reference in New Issue
Block a user