Lesson 3 : Digital Input

Theory 

In this lesson, we would like to see how to control the onboard piezo buzzer. For this we will use the onboard push button and the led on Pin 2.

Code

 

 

Result

In this lesson we learned how to use the push button as a digital input. The led on pin 2 will follow the state of the push button.