I am currently working on a project of Li-Fi. So I used manchester encoding for transmission of bits and works fine (no flickering observed) when I use delay(1). But I need to bring it to microseconds. So first I tried delayMicroseconds(500) but the light was flickering. So I changed it to delayMicroseconds(1000) but flickering was there too. What is the difference between delay(1) and delayMicroseconds(1000) and how can I reduce it to delayMicroseconds(500). Here is my code.
Txlog21.ino (1018 Bytes)