Soldering the music maker shield:
Because our music maker shield came in pieces, we had to solder the parts according to Adafruit's online instructions. Since solder includes lead, we were careful not to breath in the fume and used a fume extractor whenever we soldered.
We then inserted an SD card with two files of music carefully named to match the format in the code. We had named them incorrectly before this to find that the music doesn't play unless it is named "Tracknnn" where is an integer 0-9. We also needed exactly 8 characters in our name. We connected a headphone to the black port and ran the following code:
The songs played while the serial monitor showed "played." When the music stopped playing, the monitor printed "done playing." Since this worked well, we tried connecting our speaker to the blue ports and ran the code again. While the music played and the serial monitor showed the appropriate status reports, the volume was really low. Circled in the code above is a part that controls the volume. As it is the volume is set to (20,20) and it says that the lower these numbers, the higher the volume. So we ran the code over and over with much lower numbers but still couldn't adjust the volume.
We asked for Amy's help at this point and moved on to work on the servo and LEDs.
Servo and LEDs in one:
We used the following code to operate the servo and LEDs together. Because we defined PreviousMillis (the total time that has passed since the program started running) as an integer and not as an unsigned long, we had problems on the second or third rounds of running the system. The value of previousMillis would get stuck and give us only one LED lighting up instead of the expected pattern.
We also had a hard time making the servo stop after a certain amount of time. As we tried to troubleshoot the servo's tendency to never stop running, we learned that we were using a continuous servo motor that keeps increasing its angle with each round. Even as it oscillates back and forth, its net position shifts. This is not ideal for a movement we plan to resemble that of human wrists, because wrists don't keep on rotating infinitely. Once we switched our servo motor to the correct type, we still noticed that the command that tells it to go to a specific position and stay didn't work. Part of our goal for the next week is to work on controlling the servo better.
The document process is very clear and easy to follow :-)
ReplyDeletereally like the idea! even like how you got the serial to print when the music was done playing
ReplyDeleteThis comment has been removed by the author.
ReplyDeletethat's really frustrating how the music file needs to be named something so specific! Y'all look like you're making a lot of really good progress – I wish y'all luck on figuring out what's going on with the servo and music!
ReplyDelete