Search found 19 matches

by randomhuman
Thu Jun 19, 2014 3:41 pm
Forum: Hardware Projects
Topic: Module for TMP102 temperature sensor
Replies: 16
Views: 28948

Re: Module for TMP102 temperature sensor

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.
by randomhuman
Thu Jun 19, 2014 2:31 pm
Forum: Programs, Libraries and Tools
Topic: picoweb - Web micro (well, pico) framework (with webserver, etc.)
Replies: 25
Views: 38881

Re: picoweb - Web micro (well, pico) framework

Will this be usable to serve an API or web interface for an application running on a microcontroller board, or is it more intended for the unix port?
by randomhuman
Thu Jun 19, 2014 2:26 pm
Forum: Hardware Projects
Topic: Module for TMP102 temperature sensor
Replies: 16
Views: 28948

Re: Module for TMP102 temperature sensor

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...
by randomhuman
Thu Jun 19, 2014 1:53 pm
Forum: Hardware Projects
Topic: Module for TMP102 temperature sensor
Replies: 16
Views: 28948

Re: Module for TMP102 temperature sensor

fma wrote:I like your approach!
Thanks!
by randomhuman
Wed Jun 18, 2014 2:41 pm
Forum: Hardware Projects
Topic: Module for TMP102 temperature sensor
Replies: 16
Views: 28948

Re: Module for TMP102 temperature sensor

I reorganised the module into a package so that features only need to be imported if required. When the package alone is imported, the Tmp102 class only contains functionality for reading the temperature, but nothing for configuring the device. When a feature submodule is imported, it adds the requi...
by randomhuman
Wed Jun 18, 2014 10:45 am
Forum: Hardware Projects
Topic: Module for TMP102 temperature sensor
Replies: 16
Views: 28948

Re: Module for TMP102 temperature sensor

Let's see... It uses about 22K immediately after import, which does seem excessive. A good chunk of that is the module docstring; with that removed, usage is reduced to 15K. Personally I like to be able to browse around source and have it documented internally, but in this context it is going to hav...
by randomhuman
Mon Jun 16, 2014 9:53 pm
Forum: Hardware Projects
Topic: Light printer
Replies: 3
Views: 6919

Light printer

Playing around with a micropython board and some Adafruit "Neopixel" LEDs to make a light printer. https://pbs.twimg.com/media/BqSBWhPCEAAvXDX.png:large It's not very sophisticated as yet. I tried to key the updates to the accelerometer, but it turned out I got more consistent results just updating ...
by randomhuman
Mon Jun 16, 2014 5:20 pm
Forum: General Discussion and Questions
Topic: Problem with multiple ADCs
Replies: 3
Views: 4912

Re: Problem with multiple ADCs

Cool, thanks. That would have been a bit beyond me.
by randomhuman
Mon Jun 16, 2014 1:30 pm
Forum: General Discussion and Questions
Topic: Problem with multiple ADCs
Replies: 3
Views: 4912

Re: Problem with multiple ADCs

The ADCAll class seems to work as expected: from pyb import ADCAll import pyb if __name__ == "__main__": switch = pyb.Switch() pyb.delay(5000) if switch(): adc = ADCAll(12) pot_1 = 6 # pyb.Pin.board.X7 pot_2 = 7 # pyb.Pin.board.X8 while True: print("pot_1:", adc.read_channel(pot_1), "pot_2", adc.rea...