Search found 1392 matches

by pythoncoder
Tue Mar 28, 2017 7:43 am
Forum: Development of MicroPython
Topic: Adding a module error
Replies: 10
Views: 161

Re: Adding a module error

It's perhaps worth noting that the new behaviour is for compatibility with other MicroPython ports. It allows multiple filesystems to be mounted on '/', with 'flash' being the internal flash memory.
by pythoncoder
Tue Mar 28, 2017 7:40 am
Forum: ESP8266 boards
Topic: [SOLVED] exec() function doesnt return result?
Replies: 6
Views: 76

Re: [SOLVED] exec() function doesnt return result?

stijn wrote:...returning expressions as a way of error-handling is rather non-pythonic...

Indeed. I'd suggest having the caller do the exception handling.
by pythoncoder
Tue Mar 28, 2017 7:33 am
Forum: The micro:bit
Topic: help adding string module to mu or any other ide
Replies: 5
Views: 66

Re: help adding string module to mu or any other ide

An alternative (more efficient) approach is:

Code: Select all

def zfill(s, width):
   return '{:0>{w}}'.format(s, w=width)
by pythoncoder
Tue Mar 28, 2017 6:30 am
Forum: General Discussion and Questions
Topic: MicroPython
Replies: 1
Views: 26

Re: MicroPython

In my opinion the way you've done it is fine. Re threads. Avoid them unless you have a clear requirement: they add complexity to the debugging process and use resources. Threads offer one approach when you need concurrency. Say one of your functions were to "block" - i.e. wait for some eve...
by pythoncoder
Mon Mar 27, 2017 6:27 am
Forum: General Discussion and Questions
Topic: C enviroment that can read python occasionally, is micropython what I want?
Replies: 12
Views: 222

Re: C enviroment that can read python occasionally, is micropython what I want?

Would it be feasible to strip MicroPython down further? MicroPython implements Python 3.4. Presumably it could be reduced if it were reduced to a subset along the lines of a much earlier version. Surely easier than specifying a language and writing a compiler from scratch. I cut my Python teeth (fan...
by pythoncoder
Mon Mar 27, 2017 6:02 am
Forum: ESP8266 boards
Topic: Saving power
Replies: 12
Views: 2175

Re: Saving power

To disable WiFi you need the following:

Code: Select all

import network
ap = network.WLAN(network.AP_IF)
ap.active(False)  # Disable access point
sta_if = network.WLAN(network.STA_IF)
sta_if.active(False)  # Disable station interface
by pythoncoder
Sun Mar 26, 2017 4:25 pm
Forum: Other Boards
Topic: Esp32 port
Replies: 32
Views: 1867

Re: Esp32 port

Thanks for testing, Robert. That latency is dire. Even worse than the ESP8266 :(
by pythoncoder
Sun Mar 26, 2017 11:20 am
Forum: Development of MicroPython
Topic: Adding a module error
Replies: 10
Views: 161

Re: Adding a module error

MicroPython has no mechanism for dynamically loading C modules. You have to flash a firmware build which has been compiled with your module.
by pythoncoder
Sun Mar 26, 2017 11:17 am
Forum: Programs, Libraries and Tools
Topic: rshell - connecting my lopy board?
Replies: 1
Views: 43

Re: rshell - connecting my lopy board?

You haven't told us how you're connected and what OS you're using. If you're connected via USB you need to know the device name. On Linux you can issue ls /dev/tty* You'll probably find an entry like ttyACM0 or ttyUSB0 (I haven't got a PyCom board to test). Then all you need is rshell -p /dev/ttyUSB...
by pythoncoder
Sun Mar 26, 2017 9:55 am
Forum: Other Boards
Topic: Esp32 port
Replies: 32
Views: 1867

Re: Esp32 port

What is the general state of the ESP32 port? I'm wondering if an ESP32 will overcome some of the reliability issues I've experienced with the ESP8266.

Has anyone tested pin interrupts and the UARTS? @Roberthh if pin interrupts work, have you measured the latency?

Go to advanced search