Pins and Resistor

Yes it's a bit high but it will do.

Is anything wrong in my code?

Well I would say yes.

I can't see how you are modulating the IR, it just looks like you are turning it on and off. If you are driving a TV set it will require that it be modulated. That means turned on an off rapidly on top of the timings you have. This modulation frequency is typically 38KHz but can range from 32KHz to 40KHz. Do you know what modulation frequency your TV is expecting / your remote gives?