主题:程序 共有46516人关注过本帖 |
---|
ARM新手 |
1楼 |
![]() |
程序 ![]()
// pwm.cpp : Defines the entry point for the application.
// #include "stdafx.h" #include "EM9000_ISA_API.h" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR    lpCmdLine, int       nCmdShow) { // TODO: Place code here. float a=60.0; float b=0.0; while(1) { EM9000_PWMOUT( 0, &a, &b ); Sleep(40); b=b+0.1; if (b>=99.9) b=0.0; } return 0; } 我想请问下程序里面的b=b+0.1为什么不能出现波形,而只有大于等于0.5时才可以,而且出现的波形为什么不是平稳的呢? |
单帖管理 | 引用 | 回复 ![]() |
x10 |
2楼 |
![]() |
![]()
你的程序是一个循环设置PWM,如何能得到稳定的波形呢。仔细分析你的代码。
|
单帖管理 | 引用 | 回复 ![]() |