Hello Arduino community!
I'm currently working on a little aid for a board game. The idea is for a player to slap a box, triggering a program through a piezo speaker acting as an analog input.
The program causes red and green LEDs to flash back and forth, until grinding at a halt at either one. At this point, I want a sound to play, depending on whether the result was green or red. Red being a demonic laughter, and green being an angelic choir (in all their 8-bit glory).
I'm on track for all of the code, apart from the sound.
Now, I know that playing audio through an arduino board is very restrictive. Recreating these two sounds using tone() just seems way too finicky, though.
It seems to me that the easiest way to do this would be to use squawk, and convert an existing audio file to raw data to be used by squawk. This is as far as I've gotten though.
I have two issues that need solving -
This is my setup
Arduino: 1.6.3 (Windows 7), Board: "Arduino Uno", Processor: ATmega 328P
1.
I've tried to copy over the squawker code available here along with the song "TheOriginalSquawk". Upon attempting to compile it, though, I get these errors -
C:\Program Files (x86)\Arduino\libraries\Robot_Control\src\ArduinoRobot.cpp:3:18: fatal error: Wire.h: No such file or directory
#include "Wire.h"
^
compilation terminated.
I've chosen the correct pin etc., as told in the comments of the host code. As far as I've understood it, the issue is with the library squawker is attempting to get data from, but I've been unable to find a solution.
I only started working with Arduino two days ago (started programming about a month ago), and I wasn't able to figure out what is wrong through the minimal guidance available at the squawk github/google.
2.
The second issue is converting the .wav file I've found into data. After looking around for a bit, I found a good .wav file of an evil laugh, which I've converted to a .it file in OpenMPT, and opened in the squawk2mod.exe converter. Upon doing so, a prompt tells me my selected file is too small. The file is 42,6kb.
Any help with these issues would be forever appreciated!
I'm sorry for the wall of text. I just wanted to make sure I've left you with all necessary information.
If there's something I've missed, please ask and I'll do my best to supply it!
Cheers!
cHubbz