Hello, i bought this arduino peripheral to use as an alarm. however, i have never worked with any audio peripehrals, so i do not have an understanding of what they require to work, in terms of the signal line. another problem is that i am coding my arduino in C and C++, so i am not familiar with the arduino coding structure. Here is the datasheet and a picture of the peripheral (in the datasheet). if anyone can help me understand the basics that'll be great.
The Arduino is programmed in C++
Take a look at the examples in the Arduino IDE to see the structure. Basically you must have a setup() function and a loop() function. When the IDE builds the sketch it creates a hidden main() function that initialises the Arduino hardware, calls setup() once then calls loop() repeatedly
If you put a main() function in your sketch then it is used instead of the Arduino, one but I suggest that you do not do this
The data sheet points you to the Arduino BobaBlox library, which has one or more examples. Follow that advice.
You will need a separate 5V power supply for the amplifier. The Arduino 5V output cannot handle the required power. Don't forget to connect the grounds.
how do you figure out if a peripheral can be connected to the aruino or if it needs an external power source?
An Arduino is not a power supply. Its 5V pins can only supply about 450mA so anything requiring over about 300mA should not be powered from them
For the "structure" you can start with the Blink LED Example. I almost always start with Blink LED code or one of the other basic examples as a template and add & delete code from there.
For your amplifier board you just have to hook-up power & ground and whatever I/O pin that you're using for the tone() function.