EECE 3225 Isaistool 7. Programming Assignment #2tiu d bolo laman Hint: you can single out particular...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
EECE 3225 Isaistool 7. Programming Assignment #2tiu d bolo laman Hint: you can single out particular bits using the binary bitwise and operator &: x = PORTC; if ((PORTC & 0b00000100) != 0) { Electrical Engineering Lab I } else { } Also, you can shift bits left or right by dividing or multiplying by a power of 2. Groups E,F: Write a program that configures two pins on PORTB as inputs, which we will call X1 and X2, each connected to a pushbutton, and PORTD as an output. The program should have an internal counter that updates twice per second (once every 500ms) and displays the result on a seven segment display as a hex number (0 through F), driven by PORTD through resistors. An external BCD to 7 segment integrated circuit is NOT needed and should not be used. If X1 is depressed, the counter should increment by one each count, rolling over to 0 after it counts to F. If X2 is depressed, the counter should decrement by one each count, rolling back to F after it counts down to If neither is depressed, the counter should freeze at its current value. If both are depressed, the display should flash E T r o "r" in a repeating sequence to indicate an error. The program should have a while (1) loop so that it repeatedly reads the input changes behavior when the inputs change. EECE 3225 Isaistool 7. Programming Assignment #2tiu d bolo laman Hint: you can single out particular bits using the binary bitwise and operator &: x = PORTC; if ((PORTC & 0b00000100) != 0) { Electrical Engineering Lab I } else { } Also, you can shift bits left or right by dividing or multiplying by a power of 2. Groups E,F: Write a program that configures two pins on PORTB as inputs, which we will call X1 and X2, each connected to a pushbutton, and PORTD as an output. The program should have an internal counter that updates twice per second (once every 500ms) and displays the result on a seven segment display as a hex number (0 through F), driven by PORTD through resistors. An external BCD to 7 segment integrated circuit is NOT needed and should not be used. If X1 is depressed, the counter should increment by one each count, rolling over to 0 after it counts to F. If X2 is depressed, the counter should decrement by one each count, rolling back to F after it counts down to If neither is depressed, the counter should freeze at its current value. If both are depressed, the display should flash E T r o "r" in a repeating sequence to indicate an error. The program should have a while (1) loop so that it repeatedly reads the input changes behavior when the inputs change.
Expert Answer:
Answer rating: 100% (QA)
Based on the provided description here is an example program that meets the requirements for configuring pins on PORTB as inputs and PORTD as an outpu... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Star Co. was organized on August 1 of the current year. Projected sales for the next three months are as follows: August September October The company expects to sell 50% of its merchandise for cash....
-
Find the lateral (side) surface area of the cone generated by revolving the line segment y = x/2, 0 x 4, about the x-axis. Check your answer with the geometry formula Lateral surface area = 11/13 X...
-
a. Let A be a diagonalizable n n matrix. Show that if the multiplicity of an eigenvalue is n, then A = I. b. Use part (a) to show that the matrix is not diagonalizable. A = 2 1 0 0 2 1 0 0 2
-
Find the point-slope form of the line pass- ing through the given points. Use the first point as (x 1 , y 1 ). (-3,4), (2,5)
-
A large Lucite cube (n = 1.59) has a small air bubble (a defect in the casting process) below one surface. When a penny (diameter 1.90 cm) is placed directly over the bubble on the outside of the...
-
Information concerning Toomey Company's manufacturing activities for December follows: Total December manufacturing cost was $180,000, of which $30,000 was direct labor cost. A total of 600 machine...
-
Number of classes: 6 Data set: Number of stars in the Chinese Hellenistic constellations Use the data set and the indicated number of classes to construct (a) an expanded frequency distribution, (b)...
-
D'Eon Corporation reports the following January 1, 2017 balances for its defined benefit pension plan, which it accounts for under IFRS: plan assets, $460,000; defined benefit obligation, $460,000....
-
The Conrad-Demarest Model describes the conditions that the authors feel are necessary for an empire, as well as the factors that can lead to its downfall. 1.) How well do each of these empires fit...
-
Broncos Corp. manufactures wooden frames with the bronco medallion for framing the college degrees awarded by Western Michigan University. Each Bronco frame sells for $150 and requires: 5 linear...
-
A system of 5 laentical but distinguishable particles 1 having energy 38. The single particle state ove gaitable at energies, 6, &, 26, 3. it find the are no. of particles in each (11) Sketchni(e)...
-
Hinrich Company traded machinery with a book value of $120,000 and a fair value of $200,000. It received in exchange from Noach Company a machine with a fair value of $180,000 and cash of $20,000....
-
You have just moved from Norfolk, Virginia (sea level), to Taos, New Mexico (high in the mountains), and you find yourself out of breath climbing a small hill. Three months later, climbing the same...
-
Starline is a small children's clothing manufacturer and retailer that has seen rapid growth in the last twelve months and a significant increase in employees. At a meeting of managers, a number of...
-
Looking at the below code snippet, is this code error free and if so, what will it print to the console? If the code does have errors, then describe all syntax, run-time, and logic errors and how...
-
Only Edit Photos.js and Zoom.js ONLY using JavaScript. If you can please! Here is a link where you can get the program FILES NEEDED TO WORK: https://mega.nz/folder/M6QV3IBC#a9PwpyGRDnHqdxxa7eCCRw...
-
A buffer is prepared by mixing 50ml of 0.3M phosphoric acid and 100mL of 0.25M sodium phosphate. Determine the pH of the buffer. (pKa = 2.12)
-
1A. If the researcher is concerned about the number of variables, the nature of the analysis, and completion rates, then, he/she is at which stage of the sampling design process (Figure 11.1 in the...
-
Write a program that prompts the user to enter a string and displays the number of the uppercase letters in the string. Enter a string: Welcome to Java The number of uppercase letters is 2 -Enter
-
Use the Complex class introduced in Programming Exercise 13.17 to develop the ComplexMatrix class for performing matrix operations involving complex numbers. The ComplexMatrix class should extend the...
-
Section 22.10.2 introduced Graham?s algorithm for finding a convex hull for a set of points. Assume that the Java?s coordinate system is used for the points. Implement the algorithm using the...
-
Let \(A\) and \(B\) be disjoint events with \(P(A)=0.3\) and \(P(B)=0.45\). Determine the probabilities \(P(A \cup B), P(\overline{A \cup B}), P(\bar{A} \cup \bar{B})\), and \(P(\bar{A} \cap B)\).
-
Let \(P(A \cap \bar{B})=0.3\) and \(P(\bar{B})=0.6\). Determine \(P(A \cup B)\).
-
Check whether for 3 arbitrary random events \(A, B\), and \(C\) the following constellations of probabilities can be true: (1) \(P(A)=0.6, P(A \cap B)=0.2\), and \(P(A \cap \bar{B})=0.5\), (2)...
Study smarter with the SolutionInn App