Perhaps Portb.1 is damaged(from 9V??? through the servo???) if only LED2 works as expected.
Test by replacing LED1 with LED2 and vice versa in your program.
Or try to move LED1 to another pin e.g. portb.5 just in case portb.1 is not correctly configured(depends on PIC as some pins do other things as well).
Remember to change the TRIS register also.
Bill
Bookmarks