“…if (prc >100) {prc = 100; } DAC8(prc, 0x301); /* funcao que controla TCA3F_1 */ /* delay(O.Ol);*/ le_corr(); /* le e imprime corrente da fase A */ gotoxy(45,12); cprintf("%3.5f' ,I1A); II Al =11 A; if (IIA > If) { do { prc = prcvalor; if (prc < 0) {prc = 0; } DAC8(prc, 0x301); /* delay(O.Ol);*/ le_corr(); gotoxy(10,19); cprintff' o valor de I1A = "); gotoxy (30,19) DAC8(prc, 0x301); /* funcao que controla TCA3F_1 */ delay(l); }while (prc > 0); outportb(0x301,255);/*zera corrente de saida*/ gotoxy (5,18); cprintf(" "); gotoxy (5,17) gotoxy (5,18); cprintf(" "); gotoxy (5,17) gotoxy(fimx-iniciox+l ,i); putch('*'); } } unsigned int ADC8(unsigned char I, unsigned int Adr_out, unsigned int Adr_in) { unsigned int ADC_out = 0; I = 2 + (I * 8); /* calcula palavra de controle do ADC */ outportb(Adr_out,I); /* seleciona o chip e escolhe entrada */ outportb(Adr_out,I+4); /* habilita latch */ delay(50); outportb(Adr_out,I); /* habilita saida */ delay(25); ADCout = inportb(Adr_in); /* le dados saida */ outportb(Adr_out,0); /* desabilita chip */ return ADC_out; } void DAC8(float pre, unsigned int Adr_out) { float pwr = 0.0; float pwr_d = 0.0; pwr = 2.55 * (100pre); pwr_d = pwr -(int)pwr; if(pwr_d >= 0.5) pwr = pwr + (1 -pwr_d); else pwr = pwr -pwr_d; outportb(Adr_out, pwr); } void le_corr() { HA = ADC8(1, 0x302, 0x300); HA = I1A /100; I1A =I1A * 3;…”