but i don't know how good it is
Code of this kind is generally not usable in a real project as it requires fast and fairly constant loop() execution. You should put it inside of a timer isr so its execution is independent of loop() timing.
but i don't know how good it is
Code of this kind is generally not usable in a real project as it requires fast and fairly constant loop() execution. You should put it inside of a timer isr so its execution is independent of loop() timing.