This problem is really stumping me. I made a simple printed circuit board with an ATtiny85, a 128x64 I2C OLED display, and a Sharp IR analog distance sensor. You can view the circuit here: circuits.io.

If I turn the system on using the simple 3-pin slide switch that I put on the board, the screen does not turn on. I can see that the system is powered though, because I can see a little bit of red light escaping from the IR sensor where some of the IR light borders on the visible end of the spectrum. If I turn the board off then immediately turn it back on, the display powers up just fine. If I upload a new program to the board and use the programmer's 3.3v power I don't need to do it twice - the screen works first time.

I'm using a 3.7v LiPo battery, so I know power is not an issue (everything is 3-5v tolerant, and the LiPo battery can deliver plenty of current). Why do I need to turn it on twice in order for the screen to work? Thanks!

  • 2
    Add a delay at the start of your program before you initialise the display. It sounds like the display is taking a moment to charge its capacitors and become ready.
    – Majenko
    Commented Dec 5, 2016 at 12:23
  • @Majenko Awesome, thanks. A 100ms delay before starting the screen solved it nicely
    – Alex Wulff
    Commented Dec 5, 2016 at 22:43

1 Answer 1


Adding a 100ms delay before calling oled.init(0x3c); oled.clear(); oled.startScreen(); made this problem go away.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.