Lego Beacon Mode code

Greetings, Merry Christmas all.

I am trying to replicate:

DOES ANYONE HAVE CODE ALREADY WRITTEN?

I have had a quick attempt based on circuit in you tube video but no luck. Will upload my code, circuit set-up and components if no one has code off hand. Seems like a few people have done it so hoping theres code that already works. Or if anyone has some sick googling skills and can find it on-line that would be lovely. I did have a look though.

The Lego IR protocal can be found: http://storage.technicbricks.com/Media/2010/TBs_20100304_1/LEGO%20Power%20Functions%20RC%20v120.pdf

Attached is the closest thing I have found that I used for reference but doesn’t seem to have obvious beacon mode?

PFcentral-4trains - version2.ino (11.9 KB)

Every one stop stressing figured most of it out.