Noob: access to variable assigned Objects
Posted: Sun Jun 20, 2021 5:28 am
say I:
motor_forward = machine.Pin...
motor_backward = machine.Pin....
& I wish to create 2 routines
def forward():
backward():
is it possible to initialise the pin's within the main body of code & gain access to them within my sub routines...?
or
is it possible to initialise the pins within there own routine e.g. def init():, run the init routine and still gain access to the pins via
other routines...
motor_forward = machine.Pin...
motor_backward = machine.Pin....
& I wish to create 2 routines
def forward():
backward():
is it possible to initialise the pin's within the main body of code & gain access to them within my sub routines...?
or
is it possible to initialise the pins within there own routine e.g. def init():, run the init routine and still gain access to the pins via
other routines...