How to write a binary code to make this emitting light in real life?