Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

1) Very basic circuits 0.5 Amps pass through a 100-Ohm resistor. What is the voltage across the resistor? What is the law that you are using to solve this problem?

2) Given the circuit in the below figure. Ignore B1 and B2, they are included for completeness only. Current directions should be as they are here and you should not assume anything regarding the directions.

96_Circuit.jpg

a. Use Kirchoffs Current Law to find I3, if I1 = 4 Amps and I2 =1 Amps, at node 1.

b. At node 2, If I4 is 5 Amps, what is I5?

3) Short answer questions:

a. Mention three different methods to program an Arduino processing board? 1.

b. Provide the C (not Ardiuno) program statement to set ONLY PORTB pins 1 and 7 to logic one. Use bit-manipulation techniques.

c. Provide the C (not Ardiuno) program statement to reset ONLY PORTB pins 1 and 7 to logic zero. Use bit-manipulation techniques.

d. Given a sinusoid with 500 Hz frequency, what should be the minimum sampling frequency for an analog-to-digital converter, if we want to faithfully reconstruct the analog signal after the conversion? What is the name of the theorem that solves this problem? This was discussed in the Lecture several times.

e. If an analog signal is converted by an analog-to-digital converter to a binary representation and then back to an analog voltage using a DAC, will the original analog input voltage be the same as the resulting analog output voltage?

Circle your answer: YES NO. Explain your answer very briefly.

f. Describe the flow of events when an interrupt occurs.

g. There are two methods to doing GPIO that we discussed in Lecture. Name them. In the lecture, we had a funny unscientific name to one of them, mention it.

4) Given the code below:

a. Comment on each line of code as to what does that line of code do.

Use the comment symbols

b. Convert the Ardiuno Library functions except delay() to C code that manipulates the registers of the PORTs.

int led = 13;

voidsetup() {
pinMode(led, OUTPUT);
} void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);

1635_Ardiuno.jpg

5) A Temperature sensor circuit is described in the code below.

a. Construct the circuit similar to the figure above i.e. draw the circuit schematic.
b. Modify the behavior of the circuit you have drawn in part a above and change the code below as necessary to light up a single LED for 100 milliseconds if the temperature goes above 75 degrees F.
c. Which of these two variables degreesC or degreesFis declared in the code below? Which one can you compare against?
d. Answer the questions in the comment next to each statement in the code.
e. Add the necessary modifications to the circuit that would cope with your changes to light up the LED when the temperature is between 75 degrees F and 85 degrees.

/*TEMPERATURE SENSOR

Use the "serial monitor" window to read a temperature sensor.

The TMP36 is an easy-to-use temperature sensor that outputs a voltage that's proportional to the ambient temperature.

Hardware connections:

The temperature sensor has a triangle logo and "TMP" in very tiny letters.

When looking at the flat side of the temperature sensor with the pins down, from left to right the pins are: 5V, SIGNAL, and GND.

Connect the 5V pin to 5 Volts (5V).
Connect the SIGNAL pin to ANALOG pin 0.
Connect the GND pin to ground (GND).

We'll use analog input 0 to measure the temperature sensor's signal pin. It analog input pin reads a value between 0 and 1024.
*/

constinttemperaturePin= 0;
void setup()
{
// What does this function do?
Serial.begin(9600);
}
// Why does this function return void?
void loop()
{
floatvoltage, degreesC, degreesF;
// What is the purpose of each of the statements below?
voltage= getVoltage(temperaturePin); //
// Now we'll convert the voltage to degrees Celsius.
degreesC= (voltage - 0.5) * 100.0; //
degreesF= degreesC* (9.0/5.0) + 32.0; //
Serial.print("voltage: ");
Serial.print(voltage);
Serial.print(" deg C: ");
Serial.print(degreesC);
Serial.print(" deg F: ");
Serial.println(degreesF);
delay(1000);
}
floatgetVoltage(intpin)
{
return(analogRead(pin) * 0.004882814);
}

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92054170
  • Price:- $85

Priced at Now at $85, Verified Solution

Have any Question?


Related Questions in C/C++

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As