Analog Signal

There are two types of electric signals, analog and digital. Analog signals are continuously varying while digital signals are discrete and have specific values.

Digital signals can be processed very quickly and can be used to represent signals of different values while analog signals are naturally occuring and do not have discrete voltages

Debouncing a switch

Electrical contacts in mechanical pushbutton switches often make and break contact several times when the button is first pushed. A debouncing circuit removes the resulting ripple signal, and provides a clean transition at its output.

Task: Read a switch and make it toggle the led

Three solutions

  • 1. Simple reading of the switch without debouncing
  • 2. Debouncing the switch using the delay() function
  • 3. Debouncing the switch using the millis() function
  • Debouncing should be done to minimize the errors