ChrisRR
Newbie level 6
I'm not an amazing C programmer so bear with me.
On my PIC I have 5 controls that have one input and one output each. They have a structure on the C code that stores the variables and I want it to store the pins that it's interfacing too.
Say that the pin i want to interface is PORTDbits.RD0, how would I include that in my structure?
I presume that it would be some sort of pointer but I'm not too sure how to define that. What sort of data type does the pin pointer need to be?
If I'm completely on the wrong track then please let me know how it should be done
Added after 29 minutes:
Also I just realised my stupid mistake that I should be using LATDbits instead of PORTDbits. But either way, that's irrelevant to my question.
On my PIC I have 5 controls that have one input and one output each. They have a structure on the C code that stores the variables and I want it to store the pins that it's interfacing too.
Say that the pin i want to interface is PORTDbits.RD0, how would I include that in my structure?
I presume that it would be some sort of pointer but I'm not too sure how to define that. What sort of data type does the pin pointer need to be?
If I'm completely on the wrong track then please let me know how it should be done
Added after 29 minutes:
Also I just realised my stupid mistake that I should be using LATDbits instead of PORTDbits. But either way, that's irrelevant to my question.