Complete the code to set the PWM output on pin 9 to half brightness.
analogWrite(9, [1]);
The value 128 sets the PWM duty cycle to about 50%, which is half brightness.
Complete the code to set pin 6 as an output before using analogWrite.
pinMode(6, [1]);
Pin 6 must be set as OUTPUT to use analogWrite for PWM output.
Fix the error in the code to correctly write PWM to pin 3.
analogWrite([1], 200);
Pin 3 supports PWM output, so it is the correct pin to use with analogWrite.
Fill both blanks to create a PWM signal with 75% duty cycle on pin 10.
pinMode(10, [1]); analogWrite(10, [2]);
Pin 10 must be set as OUTPUT. A value of 191 (about 75% of 255) sets the PWM duty cycle to 75%.
Fill all three blanks to create a dictionary mapping pins to PWM values above 100.
pwm_values = { [1]: [2] for [1] in [3, 5, 6] if [2] > 100 }The dictionary comprehension uses 'pin' as the key variable and 'value' as the value variable. The condition checks if 'value' is greater than 100.
