Complete the code to set pin 13 as an output in Arduino.
void setup() {
pinMode([1], OUTPUT);
}
void loop() {
// your code here
}Pin 13 is commonly used as the built-in LED pin on Arduino boards and must be set as output to control it.
Complete the code to turn the LED on connected to pin 13.
void loop() {
digitalWrite([1], HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}To turn on the LED connected to pin 13, you must write HIGH to pin 13.
Fix the error in the code to correctly toggle the LED on pin 13.
void loop() {
digitalWrite(13, [1]);
delay(500);
digitalWrite(13, LOW);
delay(500);
}To turn the LED on, you must write HIGH to the pin. ON and TRUE are not valid values for digitalWrite.
Fill both blanks to create a dictionary mapping pin numbers to their states for pins 12 and 13.
int pinStates[] = { [1], [2] };The array holds pin numbers 12 and 13 to track their states.
Fill all three blanks to read the state of pin 13 and store it in a variable.
int ledState = digitalRead([1]); if (ledState == [2]) { digitalWrite([3], LOW); }
Read pin 13 state, check if it is HIGH, then turn it LOW.
