The wiring diagram works like this:
P22, 23, 24, 25 are pre-wired to the SD card socket
P12 to the Head Servo
P13 to the Arm Servo
P17 to the PIR Sensor
P0 and P1 to the eye NeoPixel rings
P17 to the Speaker
A Parallax 7.5V 1.5A Power Supply (#750-00009) is plugged into the power jack. The P12 and P12 servo header jumpers are at Vin (7.5V). The P17 servo header jumper is at Vdd (5V). The two NeoPixel were soldered to three wires each for data, power and ground.
Parallax has produced tutorials on this subject. Using Audacity, you can record and modify your own sound effects, or import your own music or files. The instructions for creating the correct format are available in our Sound Library reference section [1].
The Spooky Doll Animation has two key features which run in additional Propeller Multicore processors: the NeoPixels in the eyes and the WAV file playback. This is necessary because the eyes fade even red to blue (and back) even if the animation has not been activated by the PIR Sensor. The concept is that curious onlookers will be drawn towards the doll’s eyes before it activates. The WAV files also play concurrently with the eye fading and servo control.
You can download the entire BlocklyProp code below, then use BlocklyProp Solo [2] to load it into your Propeller board.
Project50835-Spooky-Doll-Test.svg [3]
The pseudocode for this project works like this:
Start LED eye fading from red to blue, and back
If motion is detected (human, pets, etc), the PIR Sensor is triggered and the following sequence begins:
“butcher.wav” sound file is activated and plays “Come and get your meat!. . .”
Head servo centers
Arm servo goes up and down
“Yuck.wav” sound file is activated and plays a maniacal laugh “muhahahaha!”
Process repeats if PIR Sensor is triggered again
The entire code is shown below, with servo control blocks in the collapsed state.
Links
[1] http://learn.parallax.com/reference/create-audio-files-wav-players
[2] https://solo.parallax.com/
[3] https://learn.parallax.com/sites/default/files/content/AB-Blockly/Projects/Spooky-Doll/Project50835-Spooky-Doll-Test.svg