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

  Lithium ion battery technology

The paper includes Lithium ion battery technology with its advantages and disadvantages. The paper discusses about the Lithium air battery in which detailed reactions of Lithium with air including nonaqueous as well as aqueous are given.

  Power transformers and tariffs

Construction of different types of power transformer, significant energy savings

  Paper on orthogonal frequency-division multiplexing

This document is shown a paper on Orthogonal frequency-division multiplexing with advantages, disadvantages and uses.

  Function of the hmi in a scada system

This assignment contains electronics engineering questions like State the commonly found components of a SCADA (Supervisory control and data acquisition) system. and decribe the function of the HMI in a SCADA system.

  Resultant waveform of the odd harmonic series

Prepare an Excel graph showing the individual components and summated resultant waveform of the odd harmonic series resulting in an approximate square wave.

  Explain scada system

Explain the function of the HMI in a SCADA system.

  Design a 2-digit 24 second shot-clock

Design a 2-digit 24 second "shot-clock" countdown timer with pushbutton controller.

  Model a discrete-time system

To understand di erent signal models To be able to model a discrete-time system and design simple signal processing algorithms.

  Draw a relay construction diagram

Draw a relay construction diagram and briefly explain the operation of a relay.

  Frequency division multiplexing

Write a short technical report on Frequency Division Multiplexing

  Impact of electron energy

Briefly discuss the impact of electron energy, electron current and target on the Bremsstrahlung generated.

  Traffic light controller

The schematic of the traffic light controller

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