Question

A button connects pin 23 of an ATmega328 to 5V. A second button connects pin 24...

A button connects pin 23 of an ATmega328 to 5V. A second button connects pin 24 to 5V. External pull down resistors are used. Eight LEDs are connected to the Port D pins. Write a program that will turn on pins PD0-3 if the first button is pressed and pins PD4-7 if the second button is pressed. (Code should be in C).

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
A button connects pin 23 of an ATmega328 to 5V. A second button connects pin 24...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • can you please solve in c and clear 1 - General purpose eneral purpose 1/0 [30...

    can you please solve in c and clear 1 - General purpose eneral purpose 1/0 [30 pts re going to use the DDR, PORT, and PIN registers from your AVR device ions are the same as your AVR device). Assume that your AVR has. LED2) connected to pins 0, 1, 2 of Port C, respectively. In this question, you are going (the register definitions are the san • I pushbutton connected to pin 3 and Port C • 3 LEDs...

  • I need help with doing these tasks for code composer Lab 3 - Branching, Push Button...

    I need help with doing these tasks for code composer Lab 3 - Branching, Push Button and LEDs-Reading Assignment in this lab, we are going to control a LED via a push button- using general purpose digital 10 for both input (button) and output (LED) on port 1 - using Code Composer Studio. Furthermore, we are going to use a branch instruction to create an IF-ELSE structure in assembly to determine if the LED should be lit up based on...

  • Assignment 2 OBJECTIVE: Flashing LEDs connected to port pin (PIC16F877): The objective of this practical assignment...

    Assignment 2 OBJECTIVE: Flashing LEDs connected to port pin (PIC16F877): The objective of this practical assignment is to familiarize the learner with some of the PIC microcontroller commands and to learn how fixed time delay routines are generated. Fixed time delay routines are used quite often in a variety of I/O interfacing tasks such as switch contact debouncing, periodic pulse width generation, slowing down of micro-controller for human interfacing etc… PROGRAM DESCRIPTION: 1. Making use of MPLAB IDE, write firmware...

  • Lab 1-Lab Portion Part I Copy the Blink program from Figure 1-13 (page 17) in the textbook and run it on your Arduino. After verifying that the Blink program works, modify the program to make the...

    Lab 1-Lab Portion Part I Copy the Blink program from Figure 1-13 (page 17) in the textbook and run it on your Arduino. After verifying that the Blink program works, modify the program to make the on-board LED attached to pin #13 blink out "SOS" in Morse code. Use a 2 750 millisecond for long pulses. 50 millisecond for short pulses and a Part 2, Write a program that uses two pushbuttons to increase or decrease the brightness of the...

  • Question 3: In class we showed how to simply light up an LED on our Teensy...

    Question 3: In class we showed how to simply light up an LED on our Teensy microcontroller. In fact, the procedure is similar for all processors including a simpler 8-bit ATmega 328P (a.k.a Arduino Uno) For purposes of this exercise, let's say that the ATmega328 has 4 regular GPIO ports; A, B, C, and D, each with 8 pins. Every GPIO port has three registers (outlined in table below) PORTX: used to write output on a pin on port X...

  • 2. Given the following setup for GPIO (fill in all the blanks, refer to pages 1-4)...

    2. Given the following setup for GPIO (fill in all the blanks, refer to pages 1-4) GPIOB_MODER 0x10000 //GPIOB_OTYPER is not needed as its default value is zero GPIOB_OSPEEDRI=0x3000; GPIOBPUPDRI= 0x80; - a. Which port is being initialized? Port b. Describe the important features from the initialization for pin 3 Ifor example input, output, alternate function, analog, pull up, pull down, push/pull, open drain out, speed, etc.). Px3 is initialized to be c. Which pin is being initialized as an...

  • QUESTION TWO a) Given the circuit below where the button is connected to Port AO Write...

    QUESTION TWO a) Given the circuit below where the button is connected to Port AO Write the correct assembly program for Atmega32 such that when the button is pressed the seven segment starts counting from 0 to 9. The delay of transition between numbers should be one second delay. Use indirect addressing Mode. The Seven Segment is a common cathode one. M 11-12

  • C CODE LANGUAGE. MSP430. #include <msp430fr6989.h> #define redLED BIT0 // Red LED at P1.0 #define greenLED...

    C CODE LANGUAGE. MSP430. #include <msp430fr6989.h> #define redLED BIT0 // Red LED at P1.0 #define greenLED BIT7 // Green LED at P9.7 #define BUT1 BIT1 // Button S1 at P1.1 #define BUT2 BIT2 // Button S2 at P1.2 void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop the Watchdog timer PM5CTL0 &= ~LOCKLPM5; // Enable the GPIO pins // Configure and initialize LEDs P1DIR |= redLED; // Direct pin as output P9DIR |= greenLED; // Direct pin as output...

  • I have a program for Arduino written such that when I hold a button down, it...

    I have a program for Arduino written such that when I hold a button down, it will turn an LED off. I want to be able to print to the serial monitor how long the button was pressed for after I let go of the button. Does anybody have any ideas? Below is the code I have written thus far: Text of Code: #define LED RED_LED #define buttonPIN PUSH2 const int buttonPin = PUSH2; // the number of the pushbutton...

  • I am doing an Arduino Uno project where I made a "Simon says" memory game with 3 neopixel LED str...

    I am doing an Arduino Uno project where I made a "Simon says" memory game with 3 neopixel LED strips and 3 - ultrasonics. I have them working independently but I need to combine the code so they work together. Here is what I have: Memory Game #define PLAYER_WAIT_TIME 2000 // The time allowed between button presses - 2s byte sequence[100]; // Storage for the light sequence byte curLen = 0; // Current length of the sequence byte inputCount =...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT