without to check your code i think you should consider the frames (codes) of the ir Sony protocol... because Sony remotes all appear to repeat each frame a minimum of 3 times...and also i think you toggle the led by pressing too long time the button on the remote ..... add some some long pause for test
Bookmarks