Complete the code to set pin 13 as an output.
pinMode(13, [1]);
The pinMode() function sets the mode of a pin. To make pin 13 an output, use OUTPUT.
Complete the code to set pin 7 as an input with an internal pull-up resistor.
pinMode(7, [1]);
To use the internal pull-up resistor on pin 7, set the mode to INPUT_PULLUP.
Fix the error in the code to correctly set pin 2 as an input.
pinMode([1], INPUT);The first argument of pinMode() is the pin number. To set pin 2 as input, use 2.
Fill both blanks to create a dictionary that maps pin numbers to their modes for pins 4 and 5.
pin_modes = {4: [1], 5: [2]Pin 4 is set as INPUT and pin 5 as OUTPUT in the dictionary.
Fill all three blanks to create a dictionary comprehension that sets pins as output only if their number is greater than 10.
pin_modes = {pin: [1] if pin [2] 10 else [3] for pin in range(8, 15)}The code sets pins greater than 10 as OUTPUT, else INPUT.
