void SEND_OF_PULSES(uint8 cnt)
{
uint8 iw = 0;
if ( cnt > 16 )//脉冲不能大于16
return;
for ( iw = 0; iw < cnt; iw ++ )
{
CTRL = 1;
Delay_nUS(THI);
CTRL = 0;
Delay_nUS(TLO);
}
CTRL = 0;
Delay_nUS(2000);//低电平延时超过2MS,以上脉冲即发出
}
void main()
{
CTRL = 0; //CTRL is pulled low to enable the device
Delay_nUS(5000); //5MS
//the IC enters the 32ms WAIT state
CTRL = 1; //0->1:Rising Edge is Detected
Delay_nUS(1500); //1.5MS
CTRL = 0; //1-->0:Falling Edge is Detected
//Increment Pulse Counter
Delay_nUS(1500); //Begin 1.5ms LATCH Timer
//Rising Edge is not Detected after 1.5ms LATCH Timer Expired
SEND_OF_PULSES( 11 ); //Send Pulse Counter Info to Decode Block
}
这个程序有错误么?我想设置成900ma的