Programming: Part 2: A Method of Creating Reusable Code - Functions

Similar code is put into a single function to be called by two uses. In this example, two push buttons are needed to be read (evaluated) and a set code needs to be executed when each of these push buttons are pressed and released. Since these two push buttons will perform similar actions, the code is taken into a single function to be called by each of these push button conditions. Array is used in this code.



Back to blog

Leave a comment

Please note, comments need to be approved before they are published.