Kleriger wrote: ↑Fri Jan 17, 2020 10:46 am
Is it necessary to use a sleep in "main.py" when I run a loop? I know this from programming on the computer so that the CPU is not 100% used.
This is not necessary on a computer either. Only sleep if your program needs to actually slow down or to save power (i.e. if you only need to do something once per second or whatever). There's nothing wrong with 100% CPU utilization if your goal is to get something done as fast as possible.
(This seems to be a common misconception that it's bad to be at 100% CPU utilization when the truth is actually the opposite).
Kleriger wrote: ↑Fri Jan 17, 2020 10:46 am
For my program development I use a lot of serial outputs to see what my program does. Is that rather bad for the finished program for the esp32 because it also has to output the data on the serial interface or can I ignore this?
This might slow down your program (and make your program take up more space) but there's no harm in doing so.
Generally you'd do something like
Code: Select all
_DEBUG = const(True)
if _DEBUG:
log('message')
then when you change it to False, the bytecode emitter won't even generate code for the log lines.