frustrated

This commit is contained in:
2025-11-20 04:36:11 -06:00
parent c9f5b3cbb6
commit e4b9acf468
2 changed files with 6 additions and 3 deletions

View File

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

3
uart.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
minicom -D /dev/ttyACM0