Skip to content

Bootcamp: Wonwoong - #323

Open
dchfk0519-lgtm wants to merge 1 commit into
UWARG:masterfrom
dchfk0519-lgtm:master
Open

Bootcamp: Wonwoong#323
dchfk0519-lgtm wants to merge 1 commit into
UWARG:masterfrom
dchfk0519-lgtm:master

Conversation

@dchfk0519-lgtm

Copy link
Copy Markdown

No description provided.

((receive_Data[1] & 0x03) << 8)
| receive_Data[2];

pulse_width = 1000 + (adc_value * 1000 / 1023);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good eq but wrong values here you should need to use your period


/* USER CODE END TIM1_Init 1 */
htim1.Instance = TIM1;
htim1.Init.Prescaler = 47;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not the right prescaler value remember we want the lowest possible prescaler with the highest period

htim1.Instance = TIM1;
htim1.Init.Prescaler = 47;
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
htim1.Init.Period = 20000;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will change based on your prescaler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants