爱普生压电喷头行业资讯
2024-05-03
接口:
程序: #include<io8515v.h> #include<macros.h> const char zhzhuan[7]={0x06,0x04,0x05,0x01,0x03,0x02,0x00}; const char fanzhuan[7]={0x06,0x02,0x03,0x01,0x05,0x004,0x00}; const int time[5]={4000,3200,2400,1600,800}; char num; char direct; char num_run; void main(void) { DDRA=0x07; TCCR1A=0x00; TCCR1B=0x09; TIMSK=0x10; SREG|=0x80; while(1) { ; } } #pragma interrupt_handler time1coma:5 void time1coma(void) { char i,j; if(num>9) { if(num_run<5) OCR1A=time[num_run]; else if(num_run>(num-5)) OCR1A=time[num-num_run]; } else { i=(num+1)/2; if(num_run<(i)) OCR1A=time[num_run]; else OCR1A=time[num-num_run]; } if(num_run<num) { j=num_run%6; if(direct==1) PORTA=zhzhuan[j]; else PORTA=fanzhuan[j]; num_run+=1; } else { OCR1A=0x0fa0; } } 



