Question

In want to set pin 11 as an Input and Output on an Adruino Uno without...

In want to set pin 11 as an Input and Output on an Adruino Uno without using pinmode or pinwrite....How would that be done using birwise operations?

Homework Answers

Answer #1

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

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Discuss how a sinusoidal oscillator produces an output signal without an input signal. Discuss the difference...
Discuss how a sinusoidal oscillator produces an output signal without an input signal. Discuss the difference between the circuit construction of a monostable and astable multivibrator PLEASE NO HAND WRITTING...
1-Draw the schematics of a full-wave rectifier circuit without smoothing capacitor. Sketch the input and output...
1-Draw the schematics of a full-wave rectifier circuit without smoothing capacitor. Sketch the input and output voltage waveforms? 2- Draw the schematics of a full-wave rectifier circuit with smoothing capacitor. Sketch the input and output voltage waveforms?
Consider an economy in which policymakers want to increase the level of output without raising inflation....
Consider an economy in which policymakers want to increase the level of output without raising inflation. Assume that the effects of policy instruments on the targets can be represented as: • Δ?=1.3Δ?+0.3Δ? • Δ?=0.15Δ?+0.1Δ? a) Are fiscal and monetary policy linearly independent instruments? b) What policy mix would achieve a rise of 2 percent in the level of output without raising inflation? c) Now assume that Δ?= 2 Δ?. Is there any policy mix that would achieve the objectives in...
7a) Design a timer circuit with an asynchronous set and reset and a clock input, and...
7a) Design a timer circuit with an asynchronous set and reset and a clock input, and a single output, such that the output is a logic 1 for 7 clock cycles, and then switches to a logic 0. The set input may be used to set the output to 1. Your circuit should include a counter. b) Implement the above timer using behavioral Verilog.
design an efficient algorithm that, on input a set of n real numbers {x1, . ....
design an efficient algorithm that, on input a set of n real numbers {x1, . . . , xn}, outputs all distinct numbers in the set. For example, if your input is {5, 10, 9, 10, 8, 5, 12, 11, 12, 9, 7, 6, 8, 5}, then you should output {5, 10, 9, 8, 11, 12, 7, 6} (any ordering of these number is acceptable).
3. Parity generator [20] Submission file for this part: 3.circ Main circuit name: paritygen Input pin(s):...
3. Parity generator [20] Submission file for this part: 3.circ Main circuit name: paritygen Input pin(s): inputw [1], sysclock [1] Output pin(s): outputq [1] Derive a minimal state table for a Moore model FSM that acts as a three-bit parity generator. For every three bits that are observed on inputw during three consecutive clock cycles, the FSM generates the parity bit outputq = 1 if the number of 1s received in the sequence so far is odd. Thus, this is...
Write a program that takes in an integer in the range 20-98 as input. The output...
Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. I already did the coding part:num = int(input()) if 20 <= num <= 98: while num % 11!=0: print(num) num -= 1 print(num) else: print('Input must be 20-98') Question: How do you know when to use %? Why is it %11 and why not %12 or %15? How do...
In MIPS only!! make a program that multiplies a user input by 15. YOU CAN ONLY...
In MIPS only!! make a program that multiplies a user input by 15. YOU CAN ONLY USE ADDITION AND BITSHIFT OPERATIONS. Also very important, make sure its correct by using the mult and mflo operators (!More Important, explain to me how that's done!) . make sure to display user input and display the output. !!!please put comments on each line of what's happening!!!
How can I write a function in MATLAB with an input of array1 and an output...
How can I write a function in MATLAB with an input of array1 and an output of maxValue (being the highest value in array 1) without calling the built in function in MATLAB. I ned to use a loop to accomplish this.
Question 1 A sequential pattern detection circuit (state machine) has input A and output Y, which...
Question 1 A sequential pattern detection circuit (state machine) has input A and output Y, which becomes 1 whenever input pattern of 1 1 0 is detected on the input Draw the state transition diagram for this circuit. Simply use state names S0, S1, S2… without any state encoding Using one-hot-encoding draw the state transition table. Clearly show input(s). present state and next state variables and output(s). Write next state and output equations.