|
Servo and Sensor For this part of the lab, we operate a servo motor using a potentiometer. One notable function used in the code is the map() function. For 'val', we map the values of the potentiometer to the values of the full cycle of a servo motor, meaning that 0 to 1023 is mapped to 0 to 179.  Turning the potentiometer turns the servo motor
Speaker Setup Since the local Radio Shack was out of speakers, I purchased a headphone jack (part no. 274-274) and wired a positive and a negative wire to the end tabs on the jack. Note: The tabs are not polarized, which means that the wires can be connected to either side as long as they are not wired to the same tab.  Headphone jack with the back casing removed Rock Out After connecting the headphone jack to the breadboard, I 'rocked out' to some headache-inducing noises. Initially, the volume was too loud. By using a larger resistor, we can reduce the volume.  With headphones plugged in, I make myself nauseous with sounds Create Something Unique For this experiment, I connected two potentiometers and a momentary switch to create 'music', aka Robotrance. One potentiometer operated the beat while the other created sounds in the foreground. Note: When using smaller speakers, we can turn up the volume by doing the opposite of what we did in the "Rock Out" section above, by placing smaller resistors in series with the speakers.  Robotrance... doot doot doot
|