Search found 1938 matches

by jimmo
Wed Oct 28, 2020 8:29 am
Forum: General Discussion and Questions
Topic: Switching between tasks
Replies: 5
Views: 108

Re: Switching between tasks

Can you clarify what you mean... do you want task 1 for some time. THEN task 2 for some time. THEN task 3? in which case they don't need to be separate tasks What your code does is run the tasks concurrently - i.e. they're all sleeping at the same time, and if they sleep for the same amount of time ...
by jimmo
Wed Oct 28, 2020 1:11 am
Forum: Programs, Libraries and Tools
Topic: How to implement the buffer protocol
Replies: 7
Views: 113

Re: How to implement the buffer protocol

Is it possible to implement the buffer protocol in MicroPython? How? Not that I'm aware of. The buffer prototcol is all about being able to extract a "uint8_t*" out of something, which doesn't really make sense to implement in Python. However I don't quite understand what you're trying to do. The n...
by jimmo
Wed Oct 28, 2020 1:06 am
Forum: ESP32 boards
Topic: Speeding up image drawing
Replies: 3
Views: 76

Re: Speeding up image drawing

Has anyone got a suggestion on how to speed it up? Simple suggestion that might give you an easy boost -- add @micropython.native to the top of the function. But the real problem here is that there's just so much to do here. Even if that function itself was faster, it still calls self.drawPixel for...
by jimmo
Wed Oct 28, 2020 12:56 am
Forum: ESP8266 boards
Topic: Micropython question using uasyncio with ESP8266 webserver
Replies: 1
Views: 62

Re: Micropython question using uasyncio with ESP8266 webserver

Is uasyncio the right library for this? Or am I completely going down the wrong path? Yes, uasyncio can do this, but you also need to manage the socket from uasyncio via uayncio.start_server. However, I strongly recommend using an existing asyncio-based HTTP server library. My recommendation is htt...
by jimmo
Wed Oct 28, 2020 12:52 am
Forum: ESP8266 boards
Topic: Port Expander PCA9554
Replies: 4
Views: 97

Re: Port Expander PCA9554

It sounds like either the pca9554.py file isn't properly copied to the device, or can't be imported correctly.

How are you copying the files to the device?
by jimmo
Wed Oct 28, 2020 12:51 am
Forum: MicroPython pyboard
Topic: Where to get crash information/Serial REPL?
Replies: 3
Views: 87

Re: Where to get crash information/Serial REPL?

When your pyboard is plugged into your PC by USB, stdin/stdout is available over the virtual UART over the USB. On Linux you'll see this as /dev/ttyACM0, and on Windows you'll see a COM port (e.g. COM5). Look in device manager to see the list of COM ports. You can use a tool like PuTTY or miniterm t...
by jimmo
Wed Oct 28, 2020 12:47 am
Forum: General Discussion and Questions
Topic: Switching between tasks
Replies: 5
Views: 108

Re: Switching between tasks

Yes what you're doing looks right except for the "utime.sleep_ms" -- you cannot use a blocking sleep in asyncio code. But you don't need it, the "await asyncio.sleep_ms" should be all you need. So your diagram says you have three tasks that do something every 5, 5, and 2 seconds respectively. This p...
by jimmo
Mon Oct 26, 2020 10:49 pm
Forum: Other Boards
Topic: stm32f411 and sim800L
Replies: 7
Views: 169

Re: stm32f411 and sim800L

Is it possible that you're using the same UART that's used for the MicroPython REPL to talk to the GSM module? So MicroPython is trying to "execute" the output from the module?
by jimmo
Mon Oct 26, 2020 10:48 pm
Forum: Programs, Libraries and Tools
Topic: Event construction in micropython
Replies: 5
Views: 164

Re: Event construction in micropython

I have appended this section to the uasyncio tutorial to justify the use of polling in such applications. tl;dr With a cooperative scheduler, if you want to trigger a coroutine from a hardware change, interrupts offer no performance gain compared to polling the hardware. Yes, 100% agree. Great expl...
by jimmo
Mon Oct 26, 2020 10:45 pm
Forum: Programs, Libraries and Tools
Topic: Use of the display in F769Disco
Replies: 2
Views: 90

Re: Use of the display in F769Disco

I built and run MicroPython on STM32F769-Disco. Will micropython allow me to use display from the kit? This has come up a few times... people have got this working. It would be very cool to see proper support for it upstream (and the similar display on many of the other F7 and F4 DISCO boards). Two...