Test the speaker with the buttons

The odroid_go.h library and its GO instance has a Speaker instance for using the speaker easily.
So, you can play something with GO.Speaker.

Some of the GO.Speaker functions are:

setVolume(): to set volume level. The given parameter can be 0 to 11(mute).

playMusic(): to play music which is written in 8 bit integers. The given parameter is a proper sample rate for playing music.

beep(): to play a simple beep sound.

tone(): to play a simple beep sound with two parameters of a frequency and a duration in millisecond. You can omit the duration argument.

We're going to write code that plays a sound when a button is pressed.
We will use the A, B, and Start buttons and make these buttons play a sound that differs from each other.
To learn about how the buttons are used, please refer to the Buttons example.

We're also going to show which button is pressed on the LCD.
To learn about how the LCD is used, please refer to the Hello World example.

We can write source code as below:
Initialize the board by calling the GO.begin() function and put the code in the loop() function that activates when the button wasPressed().