Macbeth Robot
For my AP Literature final, I was given an open ended prompt to incorporate a quote from any piece of literature we had consumed over the course of the year into a project of our choosing. I, of course, was tempted to make a robot, so I did!
I took this old toy robot that we had lying around, broke off it’s back panel and found the speaker. From there, I hooked up an Arduino Uno to the speaker, along with an SD card on a breadboard and a battery pack, and a little program that translated a passage of Macbeth into speech, and viola! Macbeth Robot. Here’s a video and the code I used.
#include "SD.h" #define SD_ChipSelectPin 4 #include "TMRpcm.h" #include "SPI.h" TMRpcm tmrpcm; void setup(){ tmrpcm.speakerPin = 9; Serial.begin(9600); if (!SD.begin(SD_ChipSelectPin)) { Serial.println("SD fail"); return; } tmrpcm.setVolume(6); tmrpcm.play("macbeth.wav"); } void loop(){ }