[SOLVED]clearing changes and listing resources used

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
dps
Posts: 51
Joined: Mon Oct 28, 2019 9:37 pm

[SOLVED]clearing changes and listing resources used

Post by dps » Sat Dec 14, 2019 6:46 pm

Hello all,
I was thinking that it may be a good idea to see how much of your microcontrollers different resources are being used, or "filled" rather. Is there a command to check this, while in a repl?

Also, is there a way to clear all of the things that you had done to it, like importing libraries or creating directories and data? Like maybe a command or something....

cheers!
Last edited by dps on Tue Dec 17, 2019 7:46 am, edited 1 time in total.

User avatar
pythoncoder
Posts: 5143
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: clearing changes and listing resources used

Post by pythoncoder » Sun Dec 15, 2019 9:46 am

dps wrote:
Sat Dec 14, 2019 6:46 pm
Hello all,
I was thinking that it may be a good idea to see how much of your microcontrollers different resources are being used, or "filled" rather. Is there a command to check this, while in a repl?

Also, is there a way to clear all of the things that you had done to it, like importing libraries or creating directories and data? Like maybe a command or something....

cheers!

Code: Select all

import micropython, gc, uos
gc.collect()
micropython.mem_info()  # Or use arg 1 for more detail
uos.statvfs('/flash')

Code: Select all

import machine
machine.reset()
Peter Hinch

User avatar
dps
Posts: 51
Joined: Mon Oct 28, 2019 9:37 pm

Re: clearing changes and listing resources used

Post by dps » Tue Dec 17, 2019 7:46 am

OH MAN! Thank you so much!

Post Reply