Skip to content

MemoryError: memory allocation failed, allocating 932 bytes #151

@oxyrv

Description

@oxyrv

I am trying to turn on a LED but for some reason i get this error "MemoryError: memory allocation failed, allocating 932 bytes"
Full error:

Traceback (most recent call last):
File "", line 1, in
File "/lib/picozero/init.py", line 6, in
MemoryError: memory allocation failed, allocating 932 bytes

My code:

from picozero import LED

red = LED(0)
red.on()

I then ran that code:

import gc
print(gc.mem_free())

Which output me this:

171440

notes:

  • I am using Thonny IDE
  • I have Circuit Python 10.1.4
  • I am using a Pico (2020) not a Pico 2/W
  • I installed picozero using the built-in library installer from Thonny IDE

Is picozero usable on Circuit Python? If no, what's a good alternative?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions