天才一秒记住【长江书屋】地址:https://www.cjshuwu.com
%生成动画
video=VideoWriter('plaSma_magnetic_drift.avi');
video.FrameRate=10;
open(video);
forstep=1:num_steps
writeVideo(video,frames{step});
end
close(video);
”
毅吉吉说:“你这sb程序也运行不出来啊。
你这particles函数都调用错了。”
叶学德说:“那你有什么节目,sb毅吉吉?”
“我来展示一个PWM脉冲宽度调制,占空比不断循环,让小灯忽暗忽亮的程序。
#include“stm32f10x.h“Deviceheader
#include“delay.h“
intmain(void)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
GPIO_InitTypeDefGPIO_Initstructure;
GPIO_Initstructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_Initstructure.GPIO_Pin=GPIO_Pin_All;
GPIO_Initstructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOA,&GPIO_Initstructure);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);
GPIO_InitTypeDefGPIO_RRR;
GPIO_RRR.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_RRR.GPIO_Pin=GPIO_Pin_All;
GPIO_RRR.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOB,&GPIO_RRR);
GPIO_WriteBit(GPIOA,GPIO_Pin_0,Bit_RESET);
while(1)
{
GPIO_SetBits(GPIOB,GPIO_Pin_12);
GPIO_Write(GPIOA,~0x0001);
delay_tms(100);
GPIO_Write(GPIOA,~0x0002);
本章未完,请点击下一章继续阅读!若浏览器显示没有新章节了,请尝试点击右上角↗️或右下角↘️的菜单,退出阅读模式即可,谢谢!