1. I solved the NANO board problem with resident’s help. Check all of tools bar to choose the right board.
2. Try another board if there is an error.
3. tone(pin, frequency, duration); delay(); I feel like I could make a band by control the frequency, duration and delay of the speaker. tone(pin, frequency, duration).
4. Serial.println(); is a good way to debug.