Lesson goal: Study your button pushing reaction


In a previous lesson, you saw how to read the status of a push-button switch. The result was either a 0 or a 1. In still another lesson, you were introduced to the concept of a histogram. Let's combine the two in this lesson, to learn more about histograms in the context of analyzing some real data.

Wire up the circuit shown below, then run the following code. Press the button as fast as you can, 10 times. What do you see as the output?
Move the mouse over a dotted box for more information.

timedigitalchange will allow you to precisely time how long it takes you to press (then release) the push button switch. This time is to be histogrammed. Start with the default code to see how this timing works. When done, paste in and run the "histogram" code below to handle the histogramming.

Now you try. Understand how timedigitalchange works, then histogram 100 of your presses.

Type your code here:

See your results here: