Good day everybody,
I am just discovering swordfish, and this is my first post on this forum.
I found the modularity of swordfish very handy, and I am looking for designing some modules as a training. One of them encapsulate the functions for use a max7219 for driving 7seg.
Here is my question: is there a way to pass the CS pin to the module "on the fly" ? I have a pic driving 2 max7219 sharing the same data and clock lines and must be able to select one or the other upon the datas to display. For that, I have to pass the relevant CS pin on the fly to the routines inside the module.
Is there a way to do that ?
By advance, thanks,
Robert
Is it possible to pass a pin as parameter ?
Moderators: David Barker, Jerry Messina
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
See the 'Blink - 2.bas' example supplied with the compiler. It's very simple to pass a pin, for example,
Code: Select all
Sub MySub(ByRef pPin As Bit)
... your code
End Sub
MySub(PORTD.7)