Search found 169 matches

by Christian Walther
Sun Feb 28, 2021 11:48 am
Forum: ESP8266 boards
Topic: random.randint() not exists in esp8266 ?
Replies: 4
Views: 2708

Re: random.randint() not exists in esp8266 ?

This doesn’t work for several reasons. Lines are in the wrong order (variable is used before assignment). It gives you values outside of the requested range (try with min = 0, max = 0x1fffffff, getrandbits(30) = 0x3fffffff). It doesn’t give you a uniform distribution, some values are more likely tha...
by Christian Walther
Fri Feb 19, 2021 10:07 pm
Forum: General Discussion and Questions
Topic: Problem Installing Required Dependencies
Replies: 2
Views: 1352

Re: Problem Installing Required Dependencies

I think you now need to get the toolchain from https://developer.arm.com/tools-and-sof ... /downloads , but I’m not sure (have never built for STM32 myself), and I don’t know which version is best.
by Christian Walther
Fri Feb 19, 2021 2:02 pm
Forum: ESP8266 boards
Topic: random.randint() not exists in esp8266 ?
Replies: 4
Views: 2708

Re: random.randint() not exists in esp8266 ?

As far as I recall, random.getrandbits() is the only function available on ESP8266 (check help(random)). You can build anything else you need on top of that. Here’s a ready-to-use example.
by Christian Walther
Fri Feb 12, 2021 3:03 pm
Forum: General Discussion and Questions
Topic: Simple Key Trap
Replies: 3
Views: 1463

Re: Simple Key Trap

Reword your requirement a little and you have the answer: “don't continue until the button is released” = “while the button is pressed, don’t continue” = while button_up.value() == 1: utime.sleep(.01) Substitute that for your original utime.sleep(.01) . Blocking the program while the button is press...
by Christian Walther
Fri Jan 29, 2021 11:40 am
Forum: General Discussion and Questions
Topic: Load files over wifi
Replies: 4
Views: 1821

Re: Load files over wifi

WebREPL allows file transfer using either the HTML or command-line client.
by Christian Walther
Sat Jan 23, 2021 3:11 pm
Forum: Programs, Libraries and Tools
Topic: WebREPL freeze
Replies: 3
Views: 2586

Re: WebREPL freeze

To check whether the problem is with WebREPL, try a serial connection at the same time, you should see the same thing in both (what you type in one also appears in the other). If the serial connection is stuck too, the problem is not with WebREPL. The behavior you describe is expected if there is a ...
by Christian Walther
Sat Jan 09, 2021 11:42 am
Forum: Other Boards
Topic: Wio Terminal with ATSAMD51 + Realtek RTL8720DN + 2.4 screen + etc
Replies: 19
Views: 40179

Re: Wio Terminal with ATSAMD51 + Realtek RTL8720DN + 2.4 screen + etc

I don’t know but I assume the same toolchain as used to build CircuitPython should get you going. There’s a very detailed and up-to-date guide on that. As to building MicroPython, I assume the procedure is similar to other ARM-based targets such as STM32.
by Christian Walther
Tue Jan 05, 2021 10:56 pm
Forum: Development of MicroPython
Topic: MicroPython and CircuitPython
Replies: 5
Views: 3552

Re: MicroPython and CircuitPython

Weird. I just confirmed that GitHub doesn’t let you fork MicroPython if you already have a fork of CircuitPython (I thought I already had forks of both but I didn’t). I would take that up with GitHub support, it’s clearly a valid use case. A possibly less (or possibly more) confusing alternative to ...
by Christian Walther
Fri Sep 18, 2020 5:53 pm
Forum: General Discussion and Questions
Topic: Filesystem on Esp32
Replies: 1
Views: 1251

Re: Filesystem on Esp32

Cannot confirm. MPY: soft reboot Started webrepl in normal mode MicroPython v1.13 on 2020-09-02; TinyPICO with ESP32-PICO-D4 Type "help()" for more information. >>> import sys >>> sys.path ['', '/lib'] >>> with open('boot.py', 'r') as f: print(f.read()) ... # This file is executed on every boot (inc...
by Christian Walther
Sun Sep 06, 2020 6:53 pm
Forum: Development of MicroPython
Topic: Native C module: accessing objects. [SOLVED]
Replies: 27
Views: 16785

Re: Native C module: accessing objects

stijn, I think that’s what I was suggesting, or am I misunderstanding you? since framebuf is itself a native module, you can simply link against it That doesn’t work because the required functions are all static and not accessible to the linker. You’d need to use a modified version of the module wit...