Search found 48 matches

by Delebel
Thu Jun 02, 2022 12:57 pm
Forum: Programs, Libraries and Tools
Topic: Uasyncio basics
Replies: 1
Views: 1352

Uasyncio basics

I'm attempting to use asyncio as described in the tutorial on Github and the flashing led example runs fine. However as stated once a asycncio.run() is issued no other processing occurs. In my specific application I want 4 DHT22 sensors to be read one per second so every 4 seconds all the readings w...
by Delebel
Tue Mar 22, 2022 5:50 pm
Forum: General Discussion and Questions
Topic: Variable scope not understood...
Replies: 5
Views: 1869

Re: Variable scope not understood...

Globals are best avoided where possible in Python for the same reasons as in C/C++, but also because in MicroPython global lookups are relatively slow. It's best to use classes. A strength of MicroPython is that you can use bound methods anywhere you can use a normal function, including callbacks a...
by Delebel
Mon Mar 21, 2022 3:06 pm
Forum: General Discussion and Questions
Topic: Variable scope not understood...
Replies: 5
Views: 1869

Re: Variable scope not understood...

The thing that confused me about Python globals is that they are declared in the functions that want to modify the variable: a = 0 def foo(): global a # Otherwise it will create a local with the same name, set it to 42, and discard it a = 42 Thanks! Coming from a C I'm always reluctant to create gl...
by Delebel
Thu Mar 17, 2022 3:00 pm
Forum: General Discussion and Questions
Topic: Variable scope not understood...
Replies: 5
Views: 1869

Re: Variable scope not understood...

Well once you talk about it sometimes you get your own answers.... Just found that I needed to make the dht_flag in the dht_clbk() a global and bingo. In hind site coding can be frustrating when the obvious is shadowed by your pre-conceptions coming from another language... Thanks for being my liste...
by Delebel
Thu Mar 17, 2022 1:55 pm
Forum: General Discussion and Questions
Topic: Variable scope not understood...
Replies: 5
Views: 1869

Variable scope not understood...

I've began converting my home automation platform from traditional C code to micropython. The context, 4 zone DHT22 sensors that I want to read one sensor per second. Now the code shown runs in a continuous loop that worked fine prior to attempting to use the timer callback method. I've tried unsucc...
by Delebel
Mon Mar 14, 2022 8:21 pm
Forum: Raspberry Pi microcontroller boards
Topic: Pico freezes very regularly
Replies: 6
Views: 3496

Re: Pico freezes very regularly

I get a similar problem when trying to use PyCharm. I used a very simple blink.py as a start and as you mentioned it works once when the Pico is has just been connected but fails for subsequent run/debug attempts no matter if I do Crtl-D or Crtl-C I tried. I have been using Thonny but wanted to move...
by Delebel
Thu Dec 02, 2021 4:59 pm
Forum: Raspberry Pi microcontroller boards
Topic: MicroPython plugin with Pycharm Win10
Replies: 0
Views: 4024

MicroPython plugin with Pycharm Win10

A quick heads up to anyone trying to setup Pycharm for development on the Pi pico. I spent 3 days trying to figure out why the MicroPython plugin could not access/detect my pico since the Thonny application on the same machine was able do so. Turns out it was a permissions thing. Running Pycharm as ...
by Delebel
Wed May 05, 2021 4:44 pm
Forum: General Discussion and Questions
Topic: Sad farewell to pyboard and micropython, another push is needed to finish things off...
Replies: 10
Views: 8083

Re: Sad farewell to pyboard and micropython, another push is needed to finish things off...

I fully understand your frustration and I've been there done that. However the reality is that no development platform is without some issues and my hats goes off to those that help out on any forum. I'm a C programmer from way back and moving to MicroPython was a choice of a lesser evil. Traditiona...
by Delebel
Sun Jan 03, 2021 5:05 pm
Forum: Other Boards
Topic: [NUCLEO-F401RE] procedure to upload the MicroPython image
Replies: 19
Views: 23419

Re: DFU-Util works to flash generic STM32F405 board...

Well thanks to the forums info I got to flash my board (STM32F405) with the DFU-util route. Downloaded the windows version. Got fooled initially as its a DOS box application. Found an example in the help text file and Bingo! Specifically my board enumerated as STM32 Bootloader in the control panel a...
by Delebel
Sat Jan 02, 2021 7:04 pm
Forum: Other Boards
Topic: [NUCLEO-F401RE] procedure to upload the MicroPython image
Replies: 19
Views: 23419

Re: [NUCLEO-F401RE] procedure to upload the MicroPython image

After looking around the forum more I believe I will try the DFU-util route so wish me luck...Later Denis Hi all, I'm very interested in trying out the programming language starting to use a NUCLEO-F401RE board in my possession (even if not officially supported). The idea is to try starting from scr...