Why won't this work?

Scope.
The variable is defined inside setup, so can't be seen in any other function.