Group I/O - Propeller C Learning System
Hello everyone!
Radio shack put had a huge sale so I went on a little bit of a 'binge' and bought up all sorts of sensors and electronics in the region. Among those electronics was a Propeller quickstart board. I started going through the C tutorials (very good job as always, Parallax) and got to the part about controlling a 7-segment LED using the "set_directions" function.
I was wondering if there is a way to group several I/O pins that are not in order. For example I have 16 pins (1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31) but would still to be able to do something like this "set_outputs(15, 8, 0b11100111);"
Thank you,
Miles.K KC9RXB
Radio shack put had a huge sale so I went on a little bit of a 'binge' and bought up all sorts of sensors and electronics in the region. Among those electronics was a Propeller quickstart board. I started going through the C tutorials (very good job as always, Parallax) and got to the part about controlling a 7-segment LED using the "set_directions" function.
I was wondering if there is a way to group several I/O pins that are not in order. For example I have 16 pins (1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31) but would still to be able to do something like this "set_outputs(15, 8, 0b11100111);"
Thank you,
Miles.K KC9RXB
Comments
You could always use DIRA and OUTA statements. For example ...
But how would you do it otherwise?
The only way to set pin output states is by using DIRA and OUTA or through some counter output mode like video.
If you need a function to do set_outputs(15, 8, 0b11100111); on all odd pins, it is achievable. It won't be very fast though because a short algorithm would be used to set the appropriate bits based on the mapping. That is left to an exercise for the curious reader.