0

CircuitPython with Feather M4 Express and 128x64 OLED Feathe
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CircuitPython with Feather M4 Express and 128x64 OLED Feathe

by Tom_Henry on Tue Jun 29, 2021 10:20 pm

I am trying to set up the Adafruit 128x64 OLED FeatherWing with the Feather M4 Express.

I have the FeatherWing M4 Express plugged into my Mac and am using the MU editor. I have plugged the Adafruit 128x64 OLED FeatherWing on top of the Feather M4 Express.

Here is the version of CircuitPython I have installed on the board:
adafruit-circuitpython-feather_m4_express-en_US-6.3.0.uf2

Here is a screen shot of my CIRCUITPY drive: See attached Screen Shot.

I am using the following example program from Adafruit as code.py:


Code: Select all | TOGGLE FULL SIZE
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

"""
Author: Mark Roberts (mdroberts1243) from Adafruit code
This test will initialize the display using displayio and draw a solid white
background, a smaller black rectangle, miscellaneous stuff and some white text.

"""

import board
import displayio
import terminalio

print("Tom Henry")

# can try import bitmap_label below for alternative
from adafruit_display_text import label
import adafruit_displayio_sh1107

displayio.release_displays()
# oled_reset = board.D9

# Use for I2C
i2c = board.I2C()
display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)

# SH1107 is vertically oriented 64x128
WIDTH = 128
HEIGHT = 64
BORDER = 2

display = adafruit_displayio_sh1107.SH1107(display_bus, width=WIDTH, height=HEIGHT)

# Make the display context
splash = displayio.Group(max_size=10)
display.show(splash)

color_bitmap = displayio.Bitmap(WIDTH, HEIGHT, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0xFFFFFF  # White

bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
splash.append(bg_sprite)

# Draw a smaller inner rectangle in black
inner_bitmap = displayio.Bitmap(WIDTH - BORDER * 2, HEIGHT - BORDER * 2, 1)
inner_palette = displayio.Palette(1)
inner_palette[0] = 0x000000  # Black
inner_sprite = displayio.TileGrid(
    inner_bitmap, pixel_shader=inner_palette, x=BORDER, y=BORDER
)
splash.append(inner_sprite)

# Draw some white squares
sm_bitmap = displayio.Bitmap(8, 8, 1)
sm_square = displayio.TileGrid(sm_bitmap, pixel_shader=color_palette, x=58, y=17)
splash.append(sm_square)

med_bitmap = displayio.Bitmap(16, 16, 1)
med_square = displayio.TileGrid(med_bitmap, pixel_shader=color_palette, x=71, y=15)
splash.append(med_square)

lrg_bitmap = displayio.Bitmap(32, 32, 1)
lrg_square = displayio.TileGrid(lrg_bitmap, pixel_shader=color_palette, x=91, y=28)
splash.append(lrg_square)

# Draw some label text
text1 = "0123456789ABCDEF123456789AB"  # overly long to see where it clips
text_area = label.Label(terminalio.FONT, text=text1, color=0xFFFFFF, x=8, y=8)
splash.append(text_area)
text2 = "SH1107"
text_area2 = label.Label(
    terminalio.FONT, text=text2, scale=2, color=0xFFFFFF, x=9, y=44
)
splash.append(text_area2)

while True:
    pass


Here is the only output I get:

code.py output:
Tom Henry

I added a print statement to the CircuitPython code just to make sure it is doing something.

What am I doing wrong?

The OLED is supposed to be displaying:

This test will initialize the display using displayio and draw a solid white
background, a smaller black rectangle, miscellaneous stuff and some white text.

Can you help me make this work?

Thanks,

Tom Henry
Attachments
Screen Shot.png
Screen Shot.png (77.04 KiB) Viewed 278 times

Tom_Henry
 
Posts: 102
Joined: Wed Aug 26, 2020 8:19 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by dastels on Wed Jun 30, 2021 8:06 am

There shouldn't be any other output to the REPL.

Can you post clear photos of your soldering?

Dave

dastels
 
Posts: 7263
Joined: Tue Oct 20, 2015 3:22 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by Tom_Henry on Wed Jun 30, 2021 6:45 pm

Here are a couple of screen shots of the 128x64 OLED FeatherWing showing my soldering.

Tom Henry
Attachments
OLED2.png
OLED2.png (888.52 KiB) Viewed 260 times
OLED1.png
OLED1.png (912.8 KiB) Viewed 260 times

Tom_Henry
 
Posts: 102
Joined: Wed Aug 26, 2020 8:19 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by dastels on Wed Jun 30, 2021 7:34 pm

I advise redoing the soldering. Several of the joints look like they may be problematic.

See https://learn.adafruit.com/adafruit-guide-excellent-soldering and https://learn.adafruit.com/collins-lab-soldering for more on technique.

Dave

dastels
 
Posts: 7263
Joined: Tue Oct 20, 2015 3:22 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by Tom_Henry on Thu Jul 01, 2021 12:48 am

Ok, it seems to be working but I am now getting some errors from the code that I don’t understand.

Can you possibly refer me to a simpler code for Adafruit’s 128x64 OLED and maybe Adafruit’s M0 or M4 Feather?

I have seen somewhere Lady Ada showing off a readout like this but I can’t seem to find any examples code for that.

I would really like a simple example that prints out sensor readings like temperature, pressure, and humidity from say Adafruit’s BME680.

Thank you,

Tom Henry

Tom_Henry
 
Posts: 102
Joined: Wed Aug 26, 2020 8:19 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by dastels on Thu Jul 01, 2021 9:28 am

This code should work. If it doesn't, I doubt you'll get very far. So let's get it working.

What errors are you seeing?

Dave

dastels
 
Posts: 7263
Joined: Tue Oct 20, 2015 3:22 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by Tom_Henry on Thu Jul 01, 2021 1:07 pm

Ok, here we go.

I added a couple of print statements in the code to make sure the CircuitPython code is running.

Here is the code with my added print statements and the output running with a Feather M4 Express.

Code: Select all | TOGGLE FULL SIZE
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
"""
Author: Mark Roberts (mdroberts1243) from Adafruit code
This test will initialize the display using displayio and draw a solid white
background, a smaller black rectangle, miscellaneous stuff and some white text.

"""


import board
import displayio
import terminalio


# can try import bitmap_label below for alternative
from adafruit_display_text import label
import adafruit_displayio_sh1107

displayio.release_displays()
# oled_reset = board.D9

# Use for I2C
i2c = board.I2C()
display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)

# SH1107 is vertically oriented 64x128
WIDTH = 128
HEIGHT = 64
BORDER = 2

display = adafruit_displayio_sh1107.SH1107(display_bus, width=WIDTH, height=HEIGHT)
print(WIDTH, HEIGHT, BORDER)
# Make the display context
splash = displayio.Group(max_size=10)
display.show(splash)

color_bitmap = displayio.Bitmap(WIDTH, HEIGHT, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0xFFFFFF  # White

bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
splash.append(bg_sprite)

# Draw a smaller inner rectangle in black
inner_bitmap = displayio.Bitmap(WIDTH - BORDER * 2, HEIGHT - BORDER * 2, 1)
inner_palette = displayio.Palette(1)
inner_palette[0] = 0x000000  # Black
inner_sprite = displayio.TileGrid(
    inner_bitmap, pixel_shader=inner_palette, x=BORDER, y=BORDER
)
splash.append(inner_sprite)

# Draw some white squares
sm_bitmap = displayio.Bitmap(8, 8, 1)
sm_square = displayio.TileGrid(sm_bitmap, pixel_shader=color_palette, x=58, y=17)
splash.append(sm_square)

print("Tom Henry")

med_bitmap = displayio.Bitmap(16, 16, 1)
med_square = displayio.TileGrid(med_bitmap, pixel_shader=color_palette, x=71, y=15)
splash.append(med_square)

lrg_bitmap = displayio.Bitmap(32, 32, 1)
lrg_square = displayio.TileGrid(lrg_bitmap, pixel_shader=color_palette, x=91, y=28)
splash.append(lrg_square)

# Draw some label text
text1 = "0123456789ABCDEF123456789AB"  # overly long to see where it clips
text_area = label.Label(terminalio.FONT, text=text1, color=0xFFFFFF, x=8, y=8)
splash.append(text_area)
text2 = "SH1107"
text_area2 = label.Label(
    terminalio.FONT, text=text2, scale=2, color=0xFFFFFF, x=9, y=44
)
splash.append(text_area2)

while True:
    pass

Output:
Code: Select all | TOGGLE FULL SIZE
Code stopped by auto-reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

code.py output:
128 64 2

Tom Henry

Tom Henry
Last edited by adafruit_support_carter on Mon Jul 12, 2021 3:16 pm, edited 1 time in total.
Reason: added [code] tags

Tom_Henry
 
Posts: 102
Joined: Wed Aug 26, 2020 8:19 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by Tom_Henry on Thu Jul 01, 2021 11:26 pm

Ok, I have to tell you I have soldered and used many many many Adafruit devices and they all worked ok. I am very certain that my soldering was OK.

Ok, so I tried this to get around a potential soldering issue.

I used a STEEMA QT JST cable and tried 2 different CircuitPython devices (Feather M4 Express and the Metro M4 Airlift Lite) with the 128x64 OLED.

I plugged a JST STEEMA cable into the 128x64 OLED and on the above two devices I connected the four JST cables as follows:
Red to 3 volts, Black to ground, Yellow to SCL and Blue to SDA.

The code that we have been discussing ran without any errors and the OLED did nothing.

I do believe we have a defective OLED.

What do you think?

Tom Henry

Tom_Henry
 
Posts: 102
Joined: Wed Aug 26, 2020 8:19 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by adafruit_support_carter on Wed Jul 14, 2021 1:29 pm

Please post a new photo of the current state of the soldering on the OLED FeatherWing.

Also, please post a photo of the soldering on the Feather M4 headers.

As a quick sanity check, try running this simple I2C scanner to see if the OLED can at least be seen. It should print out the address.
Code: Select all | TOGGLE FULL SIZE
import board
i2c = board.I2C()
i2c.try_lock()
print(i2c.scan())
i2c.unlock()

adafruit_support_carter
 
Posts: 21068
Joined: Tue Nov 29, 2016 2:45 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by Tom_Henry on Wed Jul 14, 2021 6:48 pm

Ok, I ran your code:

import board
i2c = board.I2C()
i2c.try_lock()
print(i2c.scan())
i2c.unlock()

and here is the output:
code.py output:
[60]

Code done running

Tom Henry

Tom_Henry
 
Posts: 102
Joined: Wed Aug 26, 2020 8:19 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by Tom_Henry on Tue Jul 20, 2021 4:16 pm

Not sure what you would like me to do next.

Tom Henry

Tom_Henry
 
Posts: 102
Joined: Wed Aug 26, 2020 8:19 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by adafruit_support_carter on Tue Jul 20, 2021 4:24 pm

Please post new photos showing current soldering.

You're getting the address back (60 = 0x3C), so connections are at least good enough for that. But they may still be marginal and preventing good I2C comms for actually displaying to the OLED, which involved a lot more traffic.

adafruit_support_carter
 
Posts: 21068
Joined: Tue Nov 29, 2016 2:45 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by Tom_Henry on Mon Jul 26, 2021 8:15 pm

July 26, 2021

Adafruit’s 128x64 OLED FeatherWing purchased from Adafruit.

I have been trying to get this to work and I am convinced that it is defective.

I just purchased the Adafruit 128x32 OLED Feather Wing from Chicago Electronic Distributors. I ran Adafruit’s example code and it worked just fine. I purchased it from Chicago Electronic Distributors because they have a more friendly return policy just in case I needed to do a return.

Now let’s talk about Adafruit’s 128x64 OLED FeatherWing that I purchased from you guys.

You guys keep telling me there is a problem with my soldering joints and you keep asking for photos of my soldering. I have resoldered all the points of the 128x64 OLED FeatherWing. It still doesn’t work. I have purchased over 50 various items from Adafruit and everyone has worked just fine.

I really would like to return this to you guys for an exchange so I can get a 128x64 OLED that actually works.

Today I ran the attached example code again. Here is the output.


Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

code.py output:


There is no output on Mu as it should be, and there is nothing being displayed on the OLED.

Tom Henry
Attachments
code.py
(2.25 KiB) Not downloaded yet

Tom_Henry
 
Posts: 102
Joined: Wed Aug 26, 2020 8:19 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by adafruit_support_carter on Tue Jul 27, 2021 11:29 am

OK, we can replace the OLED. The soldering shown in the images was worth verifying to make sure it was not the issue. We needed to rule that out before just throwing replacement hardware at the problem.

Send an email to support@adafruit.com with a link to this thread and your order number and they can send you a new 128x64 OLED FeatherWing.

adafruit_support_carter
 
Posts: 21068
Joined: Tue Nov 29, 2016 2:45 pm

Re: CircuitPython with Feather M4 Express and 128x64 OLED Fe

by Tom_Henry on Fri Jul 30, 2021 10:42 pm

Just so you know. I received a replacement 124x64 OLED FeatherWing today.

I load up your example file from Author: Mark Roberts (mdroberts1243) from Adafruit code.
This test will initialize the display using displayio and draw a solid white
background, a smaller black rectangle, miscellaneous stuff and some white text.

It worked just fine. I took out the other 128x64 OLED FeatherWing and nothing, totally doesn't work.

So, the other 128x64 OLED FeatherWing was defective.

Thanks for you help.

Tom Henry

Tom_Henry
 
Posts: 102
Joined: Wed Aug 26, 2020 8:19 pm

Please be positive and constructive with your questions and comments.