How to translate the algorithm to a c program

Assignment Help Electrical Engineering
Reference no: EM13226430

The campus bus uses an embedded system that tracks the number of passengers getting in and those getting out of the bus. Two circuits with laser photodiodes, connected to RB0 (getting in) and RB1 (getting out), are used to track these numbers. At any time, the total number of passengers is equal to the total passengers entering in minus the total of those getting out of the bus. Whenever the total number of passengers in the bus reaches its maximum capacity (assumed equal to 30), the system turns on a red LED (connected to RD1). If the number is under 30, the system turns a green LED (connected to RD0).

a) Write an algorithm for the program

b) Translate the algorithm to a C program

Reference no: EM13226430

Questions Cloud

A salicylic acid reacts with acetic anhydride at the phenol : Salicylic acid reacts with acetic anhydride at the phenol group rather than at the carboxylic acid group. Briefly explain why the phenol site is preferred over the carboxylic acid site.
State a bottle of commercial aspirin gave a negative test : Tablets from a bottle of commercial aspirin gave a negative test with FeCl3. Several months later, tablets from the same bottle gave a positive test with FeCl3. How do you account for this result? Why?
Compute and interpret the z- score : should this expense be considered unusually high ( and possibly worthy of investigation by the company)? Explain your answer. d. Compute and interpret the z- score for each of the six entertainment expenses.
How important are the product design and the voice : How important are the product design and the voice of the customer?
How to translate the algorithm to a c program : The campus bus uses an embedded system that tracks the number of passengers getting in and those getting out of the bus. Two circuits with laser photodiodes, connected to RB0 (getting in) and RB1 (getting out), are used to track these numbers.
What strategies could be implemented to measure : Outline what you feel are the biggest time waster in your completion of your studies. How do you manage these time wasters to ensure you can effectively manage your time and meet your study requirements?
Why circuit is necessary to interface in sensor n microchip : The design of a home security system requires the use of sensors, including a sensor to measure carbon dioxide levels. Your search resulted in one sensor that provides an output range of [-2V, 1V].
Explain what are the molar concentrations of naoh : An aqueous solution of sodium hydroxide is labeled .010 M NaOH. What are the molar concentrations of NaOH, Na+ and OH- in the aqueous solution?
Describe how media formats, features, and trends differ : Describe how media formats, features, and trends differ around the world (in your own words)

Reviews

Write a Review

Electrical Engineering Questions & Answers

  Determine the capacitance required in a half wave

Determine the capacitance required in a half wave rectifier to produce a ripple voltage less than 0.2V. Assume that the input is a 60Hz signal with maximum voltage VM=100V

  What is the per-phase current

A three-phase substation transformer operating at 34.5kV is loaded to 24 MVA. What is the per-phase current? (assume balanced conditions)

  Determine the capacitance of each capacitor

Each of the capacitance units is built of 4 similar 100V capacitors. Determine the capacitance of each capacitor.

  Find the aliased frequency of the signal

Determine the location of the peaks in the following sampled spectrum for the following sine waves: (a.) signal frequency = 300 Hz; sampling frequency = 1 kHz (b.) signal frequency = 600 Hz ; sampling frequency = 1 kHz

  Find the magnitude and the phase of the fourier series

1) Two signals are said to be orthogonal if the integral of the product of the signals is 0 over one period of the new (multiplied) signal. Assume x(t) and y(t) are orthogonal energy signals with energy, Ex and Ey, respectively.

  Estimate the worst case variation in film thickness

A wafer 100mm in diameter is mounted in an electron-beam evaporation system in which spherical radius is 40cm. Estimate the worst case variation in film thickness between the center and edges of the wafer for an evaporated aluminium 1micro meter t..

  How receiving end maintains a constant load power factor

The SV curve can be used to understand the impact of constant power factor shunt compensation support. In this case, the receiving end is injected with a specific amount of reactive power so that the receiving end maintains a constant load power f..

  When is the binary input value in decimal

Design a combinational circuit with four inputs, x,y,w, and z, and four outputs: A, B, C, and D. When the binary input value in decimal is 3,5,6,9,10 or 12, the binary output value is one less than the input value, otherwise it is one greater than..

  Determine the noise on the output as percent fs

A system is needed to measure flow, which continuously cycles between 20 and 30 gal/min with a period of 30 sec. The required output is a voltage varying from -2.5 to +2.5 V for the cycling flow range. The sensor to be used has a transfer function..

  Design a plc program and prepare a typical i/o connection

Each start/stop station contains one NO start pushbutton and one NC stop pushbutton.

  Write an assembly code segment that calls the subroutine

Write an assembly code segment that calls the subroutine New Function if bits 5 and 6 of PORTD equal 1. Write the same code segment in part (a) using structured assembly constructs.

  Find the component of q at p in the direction of pt

(a) Determine a unit vector in the direction of Q at P(1, 2, 1) (b) Find the component of Q at P in the direction of PT where T is point (5, 3, -4) (c) Where is Q the same as the unit vector of  \(a_{x}+11a_{y}+10a_{z}\)

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd