Search found 25 matches

by ardthusiast
Sun May 15, 2022 6:30 pm
Forum: General Discussion and Questions
Topic: track program execution
Replies: 2
Views: 1074

track program execution

Hello, I was wondering if there's a way to track the execution of Micropython code. Similar to this CPython library.
by ardthusiast
Fri Apr 29, 2022 12:11 pm
Forum: General Discussion and Questions
Topic: Writing a function to invert a boolean?
Replies: 16
Views: 5177

Re: Writing a function to invert a boolean?

Yes, I was using that before I had the idea to try event handlers. I started to get some major performance issues when using more than three coroutines, so I had to look for other methods. I was able to completely replace uasyncio by utilizing timers and event handlers. And, at this point I've writt...
by ardthusiast
Thu Apr 28, 2022 1:10 pm
Forum: General Discussion and Questions
Topic: Writing a function to invert a boolean?
Replies: 16
Views: 5177

Re: Writing a function to invert a boolean?

Why can't you use a class for handling the invertable flags ? Could also work. I had considered that, and it does seem like a nicer method overall, but I think I'm going to go with the array/list/dictionary method. This discussion looks purely academic for me, but is fun :-) This is actually for a ...
by ardthusiast
Thu Apr 28, 2022 12:34 am
Forum: General Discussion and Questions
Topic: Writing a function to invert a boolean?
Replies: 16
Views: 5177

Re: Writing a function to invert a boolean?

It's for an event handler. Basically, when the event handler is called, I want it to invert the value of a boolean. The event handler can only execute functions, so I cannot use the not operator. I still don't get it. Maybe you can illustrate the problem with a few lines of code ? When the event ha...
by ardthusiast
Thu Apr 28, 2022 12:22 am
Forum: General Discussion and Questions
Topic: Writing a function to invert a boolean?
Replies: 16
Views: 5177

Re: Writing a function to invert a boolean?

pythoncoder wrote:
Wed Apr 27, 2022 6:26 pm
Would storing the booleans in an array or list help? The function could then invert any element given the index.
Hmm, that would probably work. I'll give it a try.
by ardthusiast
Wed Apr 27, 2022 5:12 pm
Forum: General Discussion and Questions
Topic: Writing a function to invert a boolean?
Replies: 16
Views: 5177

Re: Writing a function to invert a boolean?

Maybe Micropython has a way to modify the value of a variable at a certain memory address? So instead of passing the variable itself, I could pass the variable's memory address which would then allow me to directly modify the variable from inside the function?
by ardthusiast
Wed Apr 27, 2022 5:06 pm
Forum: General Discussion and Questions
Topic: Writing a function to invert a boolean?
Replies: 16
Views: 5177

Re: Writing a function to invert a boolean?

It's for an event handler. Basically, when the event handler is called, I want it to invert the value of a boolean. The event handler can only execute functions, so I cannot use the not operator.
by ardthusiast
Wed Apr 27, 2022 3:57 pm
Forum: General Discussion and Questions
Topic: Writing a function to invert a boolean?
Replies: 16
Views: 5177

Writing a function to invert a boolean?

Hi, I need to write a function that inverts the value of a specified boolean, so if its value is True it becomes False, and vice versa. I can't seem to find any great ways to do this in Python other than doing something like boolean = not boolean which would mean that I have to write a function for ...
by ardthusiast
Mon Apr 25, 2022 4:31 pm
Forum: General Discussion and Questions
Topic: TMF8801 reading junk values [SOLVED in post #11]
Replies: 14
Views: 3262

Re: TMF8801 reading junk values [SOLVED in post #11]

Thanks. Will check that out. Is it using the files from the latest release of Micropython (other than the modified timing)?