What is Nostr?
Pete Prodoehl 🍕 /
npub1z0q…kgu6
2024-07-02 16:05:53

Pete Prodoehl 🍕 on Nostr: I'm using python.microbit.org to write Python code for the micro:bit but one thing I ...

I'm using python.microbit.org to write Python code for the micro:bit but one thing I don't get is things like:

pin0.write_analog(128)
pin1.write_analog(64)

So like if I want to write a function that will work with any pin how do I do that?

Do I need a big if/else with all the pins? (pin0.write_analog, pin1.write_analog, etc.)

#python #coding #programming #code #microbit
Author Public Key
npub1z0qwn44j6vajeqheglmjgxymkkffqp0qvanqx8e0p6yx3wdukugsr0kgu6