Quantcast
Viewing all articles
Browse latest Browse all 4845

General • Re: Using all GPIO pins

Re: Using all GPIO pins
Quote hippy
by hippy » Sat Aug 03, 2024 6:14 pm

Before having to change all your code it might be worth considering that the code could be considerable simplified by creating a data table for servos, the switches which control them, and the duty values when activated or not, rather than having a long list of 'if' tests.

All those 'if' can be compressed into just a couple of lines. Untested and E&OE ...
I'm new to micropython and did think all those 'if' tests were tedious to code but couldn't see any other way around it. Thanks for illuminating my darkness. I'll give it a go.

Regards

Statistics: Posted by Andrew57 — Sat Aug 03, 2024 6:52 pm



Viewing all articles
Browse latest Browse all 4845

Trending Articles