主题最新回顾(发布时间:2010-1-23 11:27:00) |
---|
-- 作者:x10(222.210.*.*)
-- 你的程序是一个循环设置PWM,如何能得到稳定的波形呢。仔细分析你的代码。 |
主题最新回顾(发布时间:2010-1-22 21:28:00) |
---|
-- 作者:ARM新手(61.237.*.*)
-- 程序 // 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时才可以,而且出现的波形为什么不是平稳的呢? |