pwm.ini
来自「P8xC552_554单片机PWM实例程序.zip」· INI 代码 · 共 54 行
INI
54 行
define char prevState0
define char prevState1
define int NUMOFPORTS
NUMOFPORTS = 2;
//This function evaluates the pin value and the previous state of the pin
//From that data a visual representation of the pin is printed in either
//the high, low, changed condition
func char print_Pin( char pinValue, char prevState )
{
if( pinValue == 0 )
{
if ( prevState == 0)
{
printf(" | ");
}
else
{
printf(" -----*");
prevState = 0;
}
}
else
{
if( prevState == 0 )
{
printf(" -----*");
prevState = 1;
}
else
{
printf(" |");
}
}
return( prevState );
}
//This function is run to visually represent the
func void pwm_Output( void )
{
prevState0 = print_Pin( (char) PWM0PIN, prevState0 );
prevState1 = print_Pin( (char) PWM1PIN, prevState1 );
printf("\n");
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?