Hello! I am trying to have a function for my atmega328p that i can pass a port number and it would do something to said port number. In other words, say i wanted to output something to PIND7, I would have to said the DDRD as output for pin 7 and then write a digital high in PORTD Pin 7. So in my function i want to pass as a parameter say
Do something with given port (in this case D) and pin 7.
And if i wanted to do, say C and pin 4 then
Do something with given port (in this case C) and pin 4.
Can anybody point me in the right direction? I am trying to learn so if anybody can point me to some good literature that would be good too!