Search found 560 matches

by Damien
Sun Jun 17, 2018 1:26 am
Forum: Other Boards
Topic: Porting micropython pic microcontroller
Replies: 1
Views: 76

Re: Porting micropython pic microcontroller

Yes it is possible. There is already a basic port to a 16 bit dsPIC in the ports/pic16bit directory. But in my opinion it's much easier and better to use a 32 bit MCU.
by Damien
Sun Jun 17, 2018 1:24 am
Forum: General Discussion and Questions
Topic: can't convert tuple object to str
Replies: 1
Views: 68

Re: can't convert tuple object to str

MicroPython doesn't support passing a tuple of strings to endswith. You need to pass one at a time.
by Damien
Sat Jun 16, 2018 1:15 am
Forum: General Discussion and Questions
Topic: os(uos) usage for mount
Replies: 5
Views: 114

Re: os(uos) usage for mount

The FAT filesystem does need a lot of blocks to create a blank filesystem, that's why there is this minimum limit of 50 blocks. You can't really get around this, simply due to the FAT format. This number (50) was already decreased from a much larger number in the original FAT driver. Another limitat...
by Damien
Sat Jun 16, 2018 1:08 am
Forum: Development of MicroPython
Topic: [SOLVED]must MICROPY_FLOAT_IMPL be enabled if float-math is not performed?
Replies: 3
Views: 86

Re: must MICROPY_FLOAT_IMPL be enabled if float-math is not performed?

If you want to allow users to enter float objects, like in config(1.5), then that already brings a lot of "baggage" with it: the C code needs to be able to parse such numbers which means doing arithmetic behind the scenes, like 1 + 5 / 10. Then allowing users to do float arithmetic at the Python lev...
by Damien
Sat Jun 16, 2018 12:07 am
Forum: General Discussion and Questions
Topic: uctypes and spi
Replies: 3
Views: 75

Re: uctypes and spi

What is line 107 where it fails with the exception?

Can you read/write the ba CCRAM object just using normal Python array subscripts?
by Damien
Fri Jun 15, 2018 10:11 pm
Forum: General Discussion and Questions
Topic: uzlib error
Replies: 3
Views: 73

Re: uzlib error

If you can find a particular bit of data that doesn't decompress on pyboard it would be worth saving it to a file on the desktop PC to run further tests on it. You could first try decompressing it with the Unix version of micropython, and then try copying it as a file to the pyboard and decompressin...
by Damien
Fri Jun 15, 2018 10:07 pm
Forum: Development of MicroPython
Topic: [SOLVED]must MICROPY_FLOAT_IMPL be enabled if float-math is not performed?
Replies: 3
Views: 86

Re: must MICROPY_FLOAT_IMPL be enabled if float-math is not performed?

Enabling floats is pretty much all or nothing. If you let users enter floats then they can do maths on them, e.g. 1.2+3.4. And if you accept floats in some places in your modules / C functions then the compiler must require some math support code. You can disable the math module to save space, via M...
by Damien
Fri Jun 15, 2018 2:10 pm
Forum: Development of MicroPython
Topic: Finaliser/__del__
Replies: 8
Views: 123

Re: Finaliser/__del__

As mentioned, it's best practice to always clean up objects explicitly (or implicit with a context manger) e.g. close files and sockets. __del__ is always called when an object is collected by the GC (but be sure to use m_new_obj_with_finaliser). But when it is collected is another question. If ther...
by Damien
Fri Jun 15, 2018 1:48 pm
Forum: General Discussion and Questions
Topic: os(uos) usage for mount
Replies: 5
Views: 114

Re: os(uos) usage for mount

If you define the ioctl method (which is good, you should do this), then don't define the count method because count will override ioctl.
by Damien
Sat Jun 09, 2018 1:37 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio.udp lockup
Replies: 1
Views: 98

Re: uasyncio.udp lockup

You'll probably need to set the UDP socket as non-blocking after you create it, using s.setblocking(False).

For convenience you can use the uasyncio.udp.socket() function which creates a DGRAM socket and sets it to non-blocking for you.