For the above problem to solve we can use the DDRB which is the
direction register which can be used for this purpose. In these two
bits 6th and 7th are not used.
So it represents as follows: NA NA 13 12 11 10 9 8
This is the direction register for the pins 8 to 13.
Thus the bits from the right will start representing 8 and towards
left as 13.
Thus to make the pin 11 as output,
The value of DDRB = 00001000
So the above value of DDRB will set the pin 11 as output.
And if we want to set the above pin as an input, then the bit which
is 1 needs to be changed to 0 as follows.
DDRB = 00000000.
That was a nice
question to answer
Friend, If you have any doubts in understanding do let me know in
the comment section. I will be happy to help you further.
Thanks
Get Answers For Free
Most questions answered within 1 hours.