rasterweb, 5 days ago to random 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
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