Hi all
Still very basic when it comes to coding so i am a bit confused as to how reading/writing logics to ports comes about. What I am after is a sub routine that integer A will select which of the 6 pins will receive integer B to turn them on or off. I want it so any combination of leds can be on or off (so a range from 0 to 63).
One of my first sub routines involves setting up all of the ports to be either inputs/outputs (port F is all outputs at this stage). If i want to turn on a combination of leds, would i have another initialise of my port in this subroutine to change the leds I don't want on as an input? That way when i send integer B to be a 1 value, the inputs obviously won't send that logic to the leds?
I hope this makes sense, still trying to grasp all of this, but having a blast doing so.
Thanks
Still very basic when it comes to coding so i am a bit confused as to how reading/writing logics to ports comes about. What I am after is a sub routine that integer A will select which of the 6 pins will receive integer B to turn them on or off. I want it so any combination of leds can be on or off (so a range from 0 to 63).
One of my first sub routines involves setting up all of the ports to be either inputs/outputs (port F is all outputs at this stage). If i want to turn on a combination of leds, would i have another initialise of my port in this subroutine to change the leds I don't want on as an input? That way when i send integer B to be a 1 value, the inputs obviously won't send that logic to the leds?
I hope this makes sense, still trying to grasp all of this, but having a blast doing so.
Thanks