完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
|
相关推荐
|
|
谢谢分享。。。。
|
|
|
|
|
|
感谢分享,研究一下
|
|
|
|
|
|
谢谢楼主的分享
|
|
|
|
|
|
|
|
|
|
|
|
#include "stm8s.h"
#include "stm8_hw.h" #include "pid.h" extern PID xPID, yPID; void main(void) { // Hardware Initialization CLK_Config(); GPIO_Config(); PWM_Config(); ADC_Config(); // PID Parameter Initialization xPID.Kp = 4; xPID.Ki = 0; xPID.Kd = 30; xPID.integrationError = 0; xPID.prevError = 0; xPID.targetValue = 511; yPID.Kp = 4; yPID.Ki = 0; yPID.Kd = 30; yPID.integrationError = 0; yPID.prevError = 0; yPID.targetValue = 511; // Enable interrupts and start ADC & PWM. // Control logics are handled in interrupt routines. enableInterrupts(); ADC_Start(); PWM_Start(); /* Infinite loop */ while (1) { } } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval : None */ void assert_failed(u8* file, u32 line) { /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %drn", file, line) */ /* Infinite loop */ while (1) { } } #endif /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ |
|
|
|
|
|
啊啊嘎嘎嘎嘎啊嘎嘎嘎啊哥哥哥哥哥哥哥哥哥哥
|
|
|
|
|
|
啊啊嘎嘎嘎嘎啊嘎嘎嘎啊哥哥哥哥哥哥哥哥哥哥
|
|
|
|
|
|
啊啊嘎嘎嘎嘎啊嘎嘎嘎啊哥哥哥哥哥哥哥哥哥哥
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 02:28 , Processed in 0.900953 second(s), Total 85, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号