Write an Arduino Program with 1 LED and 2 buttons:
- Button 1: Pressing the button starts or stops reading the status of Button 2.
- Button 2: Tap the button any number of times.
- The ON/OFF sequence of Button 2 should be the sequence seen in the LED.
- That is, if Button 2 is pressed in the following sequence ON-600 OFF-400 ON-500 OFF-3000, the LED should blink with same sequence.
Write a program to vary the brightness of an LED using a transistor as an interface. The range of brightness should be divided into 5 levels. The user can input either one
, two
, ..., five
to get the brightness of the corresponding levels. If the maximum brightness is 100, each level should be 20. If the user enters three
, the brightness should be corresponding to level three, that is, 60.