0.96" OLED I2C Error

16 views
Skip to first unread message

James Lynes

unread,
Aug 22, 2020, 9:27:02 PM8/22/20
to HiPi Perl
I am trying to run the 0.96" OLED example program on an Adafruit v2.1 OLED board. I2C was enabled on the system config page. Vin is connected to 3.3V, I2C address is set to 0x3C.

The error is: i2c_write failed with return value -1 at /usr/local/lib/arm-linux-gnueabihf/perl/5.28.1/HiPi/Interface/MonoOLED.pm line 347.

The display never lit up. At what point in the process should i see a spash screen? Or backlight?

Thanks for any info on this issue.

James

James Lynes

unread,
Aug 22, 2020, 9:49:58 PM8/22/20
to HiPi Perl
Found a comment in the Adafruit library source that the 128x64 I2C address is 0x3D. The example HiPi code has it set at 0x3C. Change the code and reran.
I now have a splash screen:
      Raspberry Pi
             HiPi Perl
        HiPi 0.81

It did not display the rest of the example. Will scan the code some more.

James

James Lynes

unread,
Aug 22, 2020, 10:40:29 PM8/22/20
to HiPi Perl
SOLVED
------------

Had to add $oled->update_display() calls in each of the four  blocks to cause the internal buffer to be written out to the display. Buffers were being created but not copied to the display. Hope this helps someone else.

James

Mark Dootson

unread,
Aug 29, 2020, 2:16:21 AM8/29/20
to HiPi Perl
James,

Thanks for this. I'll update the examples.

Reply all
Reply to author
Forward
0 new messages