Search found 45 matches

by Primesty
Mon Aug 31, 2020 1:55 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio - How detect the end task in another task.
Replies: 50
Views: 7232

Re: uasyncio - How detect the end task in another task.

A gotcha thanks! Yeah, it's not suuuper important. Another question - can you write a function that let's you toggle between two (or more functions) via button push? I.e. first function runs, button press, second function runs, button press, first function runs again.
by Primesty
Fri Aug 28, 2020 10:04 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio - How detect the end task in another task.
Replies: 50
Views: 7232

Re: uasyncio - How detect the end task in another task.

Thanks! I'll give it a shot on the weekend. As I'm thinking through this more, are you aware of any means to generate a menu structure in micropython, where you can scroll up and down through a menu and then click with the switch to enter and maybe double click to get back out?
by Primesty
Wed Aug 26, 2020 9:37 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio - How detect the end task in another task.
Replies: 50
Views: 7232

Re: uasyncio - How detect the end task in another task.

That worked! The only thing I'm wondering is how to get the encoder value? Would I just instantiate an Encoder class, like enc = Encoder(...) and then call enc.position ?
by Primesty
Tue Aug 25, 2020 6:16 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio - How detect the end task in another task.
Replies: 50
Views: 7232

Re: uasyncio - How detect the end task in another task.

Thanks, Pete!

I tried opening encoder_portable.py at your link, but got a 404 from GitHub. In the meantime, I've been using

https://github.com/SpotlightKid/micropy ... er/encoder

which seems to work fine and integrates into the class well.
by Primesty
Sat Aug 22, 2020 6:38 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio - How detect the end task in another task.
Replies: 50
Views: 7232

Re: uasyncio - How detect the end task in another task.

Hey Pete,

Thanks as always! This indeed clarifies the approach. I've removed press_func and now have only release_func, double_func, and long_func defined and everything works as expected.

On to the next step - rotary encoder.
by Primesty
Fri Aug 21, 2020 6:30 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio - How detect the end task in another task.
Replies: 50
Views: 7232

Re: uasyncio - How detect the end task in another task.

Hey Pete, Thanks for the ESP8266 tip. I've been working some more on my temp-reader project and am testing your aswitch.py functions to be able to give the app potentially more functionality. I've also written a class method, which now shows the current temperature reliably on the OLED. Then, I went...
by Primesty
Sat Aug 15, 2020 4:52 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio - How detect the end task in another task.
Replies: 50
Views: 7232

Re: uasyncio - How detect the end task in another task.

Hey Pete, I tried installing a daily build on an ESP8266 today to get the latest version of uasyncio on there, but that led to urequests not being available anymore, which only seems to be available in stable versions. Are you aware of any ESP8266 builds, which have all standard libraries including ...
by Primesty
Tue Aug 11, 2020 1:07 pm
Forum: General Discussion and Questions
Topic: Date conversion Y-m-d H:i:s to epoch
Replies: 5
Views: 993

Re: Date conversion Y-m-d H:i:s to epoch

Awesome, thanks! I'll give that a try!
by Primesty
Sat Aug 08, 2020 1:03 pm
Forum: General Discussion and Questions
Topic: Date conversion Y-m-d H:i:s to epoch
Replies: 5
Views: 993

Re: Date conversion Y-m-d H:i:s to epoch

Hi, this might be a little tangential, but still related I'm querying an API and get a timestamp as a string returned in a JSON object - I'm using ujson to parse the JSON data and end up with a string like this: '2020-08-08T13:16:00Z' How can I reformat this into something more legible and, more imp...
by Primesty
Sat Aug 08, 2020 12:54 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio - How detect the end task in another task.
Replies: 50
Views: 7232

Re: uasyncio - How detect the end task in another task.

Gotcha, I removed the dangling main() function call

Also, the above error has resolved itself and now it's running smoothly, which means I can now move on to handling the rotary encoder or displaying the temperature.