use switch to control whether led blinks