Select Page

Mapping the LED with the Tap Sensor with the help of “map” function,  it creates the fade in and fade out effect in the glowing up of LED. Tap Sensor and Flex are a kind of sensor who themselves have varying resistance. It is interesting to note that as a hack we dont need “if”  conditional anymore to map the varying intensity of LED, we can simply use the “map”  function and play with the values. It has its limitations if you have to execute some other conditions like that of blinking of a LED, then the ideal scenario is to use “if” construct.