#include #include void xisa() { // doesn't work char aux[10] = {'A', 'A', 'A', 'A', 'A'} ; if ('A' == aux[2]) PORTB |= 0X01; // 1st led } void xisb() { // doesn't work char aux[] = "BBBBBBB"; if ('B' == aux[2]) PORTB |= 0X02; // 2nd led } void xisc() { // WORKS !!!! char aux[10]; aux[0] = 'C'; aux[1] = 'C'; aux[2] = 'C'; aux[3] = 'C'; aux[4] = 'C'; aux[0] = '\0'; if ('C' == aux[2]) PORTB |= 0X04; // 3rd led } void xisd() { // doesn't work char aux[10]; aux[0] = '\0'; strcat(aux, "DDDDDDDD"); if ('D' == aux[2]) PORTB |= 0X08; //4th led } void main(){ /*************************************************** * I/O ***************************************************/ outp(0xff,DDRB); // PORT B = OUTPUT outp(0xff,PORTB); // WRITE PORT PORTB = 0x00; // BLANKS PORT // TRY EACH OF THESE COMMANDS ALONE, // and the problem persists xisa(); xisb(); xisc(); xisd(); }