In this lab we learned how to utilize Pulse Width Modulation or PWM even more in order to demonstrate analog output. PWM can allow digital devices to produce analog output by simply turning the digital device on and off very quickly. The pulses of "on" time that are part of each period of PWM are referred to as duty cycles.
During the first part of lab we constructed the following circuit in which to control a motor from a potentiometer. We wrote a program in which we could manipulate the duty cycle of the motor by twisting the potentiometer. We also incorporated an LED in which is manipulated in the same manner as the motor.
Next we uploaded some started code provided to us in order to become more familiar with servos.
This one being a 360 degree servo:
And this one being a 180 degree servo:
Next we added a potentiometer to our circuit and mapped the analog input values of the potentiometer to the analog output values of the 180 degree servo.
In the final portion of lab we got to play with a small piezo speaker.
My partner being gifted in the art of music making looked up the frequencies for certain notes online in order to demonstrate another melody.
No comments:
Post a Comment