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

  What is the cross price elasticity of demand

What is the cross price elasticity of demand between XYZ's and AB C's widgets?

  Calculate theoretical range when measuring resistance

how to calculate theoretical range when measuring resistance with DMM (amprobe-AM530) how to adjust the tektronics TBS1104 oscilloscope Time/div to a value of 0.5ms the tektronics only let me adjust between o and 1 ms, but nothing in between.

  Determine the suitable size of cable for electrical wiring

How to determine the suitable size of cable for Electrical Wiring Installation and please with Solved Examples.

  What is the voltage induced

A coil of 2000 turns surrounds a flux of 5 mWb produced by permanent magnet. The magnet is suddenly withdrawn causing the flux inside the coil to drop uniformly to 2 mWb in 1/10 of a second. What is the voltage induced.

  Explain telephone channels and pcm analysis

Telephone channels and PCM analysis, The analog to digital converter (ADC) used in a telephone system outputs 8 bit words. The digital words are transmitted as a serial stream to form a PCM voice signal

  Explain legacy correspondent hosts and legacy applications

Mobile IP was intended to work with legacy correspondent hosts and legacy applications. However, some advantages may be gained if correspondent hosts are aware of mobility in certain ways.

  What overshoot for a step input to be expected

A control system for positioning the head of a floppy disk drive has the closed-loop transfer function T(s)=11.1(s+18) / (s+20)(s^2+4s+10). Plot the poles and zeros of this system and discuss the dominance of the complex poles.

  Write down the principle of energy conversion

Write down the principle of energy conversion and give an example for single and double excited system.

  Explain half-wave rectifier

Half-Wave Rectifier, For the half-wave rectifier, the source is a sinusoid of 120 Vrms at a frequency of 60 Hz. The load resistor is 5 ohms. Determine

  What approximate minimum ber is required for voice signals

What approximate minimum BER is required for voice signals, data signals and what is the approximate BER level for the optical fiber systems ?

  Explain why the short-circuit method for determining

Explain why the short-circuit method for determining the Thevenin resistance of a circuit cannot be applied if the circuit does not contain any independent current or voltage sources.

  Find the output voltage produced

A 6-bit DAC has an input 1001012 and uses a 10.0-V reference.

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