Hi everyone! i'm a newbie in lucid dreaming, but i'm working on a device that will flash two leds if you are in rem phase

But i'm not a very expert to code it...so i want some help by the guru of this wonderful forum in code or pseudo-code to write the algorithm of detection of rem using an ir transmitter and a ir reciever.


Thanks