Starting from:
$24.99

$18.99

Lab #6 Solution

PART1 1. Make sure your breadboard is wired according to the prelab. The potentiometer is used to adjust the voltage supplied to the microcontroller for ADC . Design a system that reads the 10-bit ADC result from the ADC register, and displays the result on a bank of 10 LEDs.

2. Revise Part 1 by replacing the potentiometer with a photoresistor and 330 ohm resistor. Take note of the highest ADC value displayed when the photoresistor is exposed to light, and the lowest ADC value displayed when the photoresistor is deprived of all light. These values will be used for the remaining lab exercises.

3. Design a system where an LED is illuminated if enough light is detected from the photo resistor.

4. Design a system, using a bank of eight LEDs, where the number of LEDs illuminated is a representation of how much light is detected. For example, when more light is detected, more LEDs are illuminated.

##PART2

1. Using the ATmega1284’s PWM functionality, design a system that uses three buttons to select one of three tones to be generated on the speaker. When a button is pressed, the tone mapped to it is generated on the speaker.

2. Using the ATmega1284’s PWM functionality, design a system where the notes: C4, D, E, F, G, A, B, and C5, from the table at the top of the lab, can be generated on the speaker by scaling up or down the eight note scale. Three buttons are used to control the system. One button toggles sound on/off. The other two buttons scale up, or down, the eight note scale.

3. Using the ATmega1284’s built in PWM functionality, design a system where a short, five-second melody, is played when a button is pressed. NOTE: The melody must be somewhat complex (scaling from C to B is NOT complex).

More products