int main(void) { // Program initalization Initialization(); fdevopen(Usart_Tx,Usart_Rx,0); printf("Hello, world!\n"); char *string; for (;;) { gets (string); if (strcmp(string, "on") == 0) { sbi(DDRB, 7); sbi(PORTB, 7); } if (strcmp(string, "off") == 0) { cbi(DDRB, 7); cbi(PORTB, 7); } } return 0; }
It seems to get past gets() but it doesn't toggle the LED when I type on or off and hit enter in the terminal. Any ideas?