Module for TMP102 temperature sensor

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!
randomhuman
Posts: 19
Joined: Mon Jun 09, 2014 1:54 pm

Re: Module for TMP102 temperature sensor

Post by randomhuman » Thu Jun 19, 2014 1:53 pm

fma wrote:I like your approach!
Thanks!

randomhuman
Posts: 19
Joined: Mon Jun 09, 2014 1:54 pm

Re: Module for TMP102 temperature sensor

Post by randomhuman » Thu Jun 19, 2014 2:26 pm

pfalcon wrote:
I guess string constants are retained even if they are not being referenced by anything?
Yes, all constant strings which appear in script are interned. But again, we made change that expressions consisting of just strings (which covers docstrings) are discarded. Submitting a bug for this issue will make sure it's revisited and not forgotten.
Before I submit any more bugs I should probably learn to build the project and flash the board and all that good stuff - it probably is fixed as you say, but I'm still running the version of micropython that came on my board and I haven't tried the unix version or anything.

randomhuman
Posts: 19
Joined: Mon Jun 09, 2014 1:54 pm

Re: Module for TMP102 temperature sensor

Post by randomhuman » Thu Jun 19, 2014 3:41 pm

I flashed my board and it looks like that issue with the docstrings is at least partially resolved - space is allocated for them on import, but the garbage collector removes them when it runs. Seems adequate to me? I will log a bug if you disagree.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Module for TMP102 temperature sensor

Post by pfalcon » Thu Jun 19, 2014 7:26 pm

Hmm, I'd guess parser could free such strings explicitly, saving gc from extra work, so I'd suggest filing a bug.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/


Turbinenreiter
Posts: 288
Joined: Sun May 04, 2014 8:54 am

Re: Module for TMP102 temperature sensor

Post by Turbinenreiter » Sat Jul 12, 2014 2:43 pm

This means that we should include docstrings in micropython modules, right?

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Module for TMP102 temperature sensor

Post by pfalcon » Sat Jul 12, 2014 4:43 pm

You can, and you should not be concerned that they may waste memory when run on MicroPython (they won't).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

Post Reply