PA Designer Learn 2: LED and Loudness Sensor
7. Global Variables
When declaring variables within a function, temporary variables that are invisible to the rest of your code will normally be created. Every call to that function generates a new set of temporary variables. If we want to create, read or update a variable that persists across the lifetime of the program and is usable by all the program’s functions, we need to declare that variable to be global.