-
Notifications
You must be signed in to change notification settings - Fork 420
Eric Chen onboarding #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Eric Chen onboarding #275
Conversation
| HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_RESET); // lower CS | ||
|
|
||
| uint8_t txData[3] = {0x01, 0x80, 0x00}; // transmit 00000001 start; 1000 0000 single-end, d1-3 =0; whatever | ||
| uint8_t rxData[3] = {0};//receive, 1. null, 2.first 2 digits, 3. rest 8 digits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do these arrays need to be inside the loop?
|
|
||
| uint16_t result = ((rxData[1] & 0x03) << 8) | rxData[2]; | ||
|
|
||
| printf("ADC value = %d\n", result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really a serious mistake but printf wouldn't work on the stm32
| TIM1.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1 | ||
| TIM1.IPParameters=Channel-PWM Generation1 CH1,Prescaler,Period | ||
| TIM1.Period=20000 | ||
| TIM1.Prescaler=47 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's more optimal parameters you can set for the timer
| MX_TIM1_Init(); | ||
| /* USER CODE BEGIN 2 */ | ||
|
|
||
| /* USER CODE END 2 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a function you should invoke to start the timer peripheral before your main loop runs
No description provided.