Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apa102 module not implemented in firmware - potential fix #3

Open
Xendi opened this issue Nov 8, 2022 · 6 comments
Open

apa102 module not implemented in firmware - potential fix #3

Xendi opened this issue Nov 8, 2022 · 6 comments

Comments

@Xendi
Copy link

Xendi commented Nov 8, 2022

apa102 module is not available in firmware.

Uploading a generic Dotstar driver (https://github.com/RobertJBabb/micropython_generic_apa102/blob/master/generic_dotstar.py) allows the LED to be accessed easily like so:

import time
from generic_dotstar import SpiDotStar as SPIDotStar
from machine import SPI, Pin

clock = Pin(39)
data = Pin(40)
num_pixels = 1

print('Testing MicroPython 1.10 SPI DotStar Compatibility Class')

spi = SPI(2, sck=clock, mosi=data, baudrate=1000000)
pixelp = SPIDotStar(spi, num_pixels)
pixelp[0] = (0, 255, 0)
pixelp.show()
r, g, b = pixelp[0]
time.sleep(2)
pixelp.deinit()
@Xendi Xendi changed the title apa102 module not implemented apa102 module not implemented in formware Nov 8, 2022
@Xendi Xendi changed the title apa102 module not implemented in formware apa102 module not implemented in firmware - potential fix Nov 8, 2022
@fundef1
Copy link

fundef1 commented Nov 9, 2022

Best not to use the HW SPI as it is also defined in tft_config.py for use with st7735. Better to use SoftSPI instead.

@mmMicky
Copy link
Contributor

mmMicky commented Nov 11, 2022

Maybe this SPI is already occupied by the screen. Modifying the SPI index number may solve it.

@fundef1
Copy link

fundef1 commented Nov 15, 2022

I did try using the other SPIs.
but two of them are used by the board (for flash/mem IIRC) the other one returned with an 'invalid configuration' no matter what I tried.

could you provide a working example using one of the other HW SPIs ?

@mmMicky
Copy link
Contributor

mmMicky commented Nov 15, 2022

SPI0 has been occupied by flash, you can use SPI1 or SPI2 or directly use the ready-made driver library
https://github.com/Xinyuan-LilyGO/T-Dongle-S3/tree/main/lib/FastLED

@fundef1
Copy link

fundef1 commented Nov 15, 2022

Ah yes, FastLED, but I'm using micropython.

I can't get SPI1 to work though, it returns with invalid configuration...

@zmactep
Copy link

zmactep commented Dec 5, 2022

Thank you for the hint. I use SoftSPI with MISO=37 and everything works fine at the same time with a display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants