Question on FramebufferDisplay and PixelFramebuffer

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
akoebbe
 
Posts: 14
Joined: Sat Jan 23, 2016 8:16 pm

Question on FramebufferDisplay and PixelFramebuffer

Post by akoebbe »

So I'm trying to get FramebufferDisplay to work with a PixelFramebuffer. For context, I have a Dotstar 8x8 HD and I want to be able to use displayio.Groups with it.

I'm trying to understand what kinds of buffers are allowed when creating a FramebufferDisplay. I've tried giving it the buf property of the PixelFramebuffer, but that gives me an error that a circuitpython_typing.FrameBuffer needs to be passed. Other than RGBMatrix, what other kinds of framebuffers can be passed in? Am I totally barking up the wrong tree?

In the end, I really just want to use displayio.Groups with the Dotstar 8x8.

Here is the code I'm trying to make work:

Code: Select all

import board
import adafruit_dotstar
import displayio
import framebufferio
from adafruit_pixel_framebuf import PixelFramebuffer

eye_cin = board.A0
eye_din = board.A1
eye_led_count = 64
eye_led_height = 8
eye_led_width = 8

dotstar = adafruit_dotstar.DotStar(eye_cin, eye_din, eye_led_count, brightness=0.1, auto_write=False)
pixel_framebuffer = PixelFramebuffer(pixels=dotstar, width=eye_led_width, height=eye_led_height, alternating=False)
DISPLAY = framebufferio.FramebufferDisplay(framebuffer=pixel_framebuffer.buf, rotation=0)

SPRITES = displayio.Group()

display.show(SPRITES)

User avatar
tannewt
 
Posts: 3298
Joined: Thu Oct 06, 2016 8:48 pm

Re: Question on FramebufferDisplay and PixelFramebuffer

Post by tannewt »

Unfortunately I don't think there is a way to do this currently. I wonder if the coming `PixelMap` could be used for this. https://github.com/adafruit/circuitpython/pull/7191

User avatar
akoebbe
 
Posts: 14
Joined: Sat Jan 23, 2016 8:16 pm

Re: Question on FramebufferDisplay and PixelFramebuffer

Post by akoebbe »

Thanks for the info. That's an exciting PR from a performance standpoint. Are you suggesting one of these options?

1. use `PixelMap` as the buffer to throw at FramebufferDisplay
2. somehow using displayio.Groups with PixelMap
3. write a displayio PixelMapDisplay implementation
4. something else?

User avatar
tannewt
 
Posts: 3298
Joined: Thu Oct 06, 2016 8:48 pm

Re: Question on FramebufferDisplay and PixelFramebuffer

Post by tannewt »

I was thinking it may not be too bad to implement #1. I haven't looked in detail though.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”