Suggest ways to make the code more efficient

Assignment Help Electrical Engineering
Reference no: EM13230242

Write an Arduino program that requests a floating point number from the user console that is between -1000 and 1000. The program is to input the number character-by-character and then assemble them together so that the original number is put into a floating point variable and displayed back to the monitor.

1. Do the computing in a function that is passed the floating point number. The number should be passed from the main function. 

2. A check should be made to see if the number is in the appropriate range.

3. This should be done using the Serial.read() command. (The comparable C command is gets()).

4. The program is intended to be used in a larger program that receives the floating point number from the console to be used within the Arduino program.

 5. Carefully comment your code.

6. Suggest ways to make the code more efficient.

Reference no: EM13230242

Questions Cloud

What approaches can be taken to develop a supply chain : What approaches can be taken to develop a supply chain infrastructure that provide an accurate view of overall channel performance?
What is the velocity of propagation in the cable : A certain transmission line is 10 meters long. Measurements indicate that the total inductance of the cable is 16 uH. Standing wave measurements indicate that the voltage reflection coefficient at the load is 0.5 + j0
Explain what is the concentration ratio of the free toxic : what is the concentration ratio of the free (and potentially toxic) Pb^2+(aq) in the blood to the much less toxic Pb^2+ -EDTA complex?
Describe impact of culture on managerial decision-making : Describe the impact of culture on managerial decision-making and describe the dimensions of power distance, uncertainty avoidance, individualism/collectivism, and masculinity/femininity.
Suggest ways to make the code more efficient : The program is to input the number character-by-character and then assemble them together so that the original number is put into a floating point variable and displayed back to the monitor.
Fifth annual clean hands report card survey : The soap and detergent association issued its fifth annual clean hands report card survey for 2009.
The injury severity between younger and older children : A study in pediatric emergency care compared the injury severity between younger and older children.
Mpg for pickup trucks is not the same for all four engine : Random samples of 2009 pickup trucks with 4 cylinder, 5 cylinder, 6 cylinder, and 8 cylinder engines were obtained. Each pickup truck was tested for miles per gallons in highway driving
Bargains on the menu-and a side of jitters : Boston Globe article "bargains on the menu-and a Side of Jitters" reported concerns

Reviews

Write a Review

Electrical Engineering Questions & Answers

  Define infinity expected number of packets in the queue

If you have an M/M/Infinity system with arrival rate lambda and service rate mu(µ), how would you show that the expected number of packets in the queue is equal

  Find the electric field intensity using spherical vectors

(a) Find the electric field intensity using Cartesian vectors, Ecart, at the free space point P(-2.00 m, 5.00 m, 2.00 m). (b) Find P in spherical coordinates. (c) Find the electric field intensity using spherical vectors, Espher.

  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..

  How to minimize the total number of gates and inverters

Design a circuit that will add either 1 or 2 to a 4-bit binary number N. Let the inputs N3, N2, N1, N0 represent N. The input K is a control signal. The circuit should have outputs M3, M2, M1, M0, which represent the 4-bit binary number M.

  Determine zero-input response

Determine zero-input response of (D2+4D+40)y(t)=(D+2)x(t) with initial condition y0(0)=2 & dy0(0)/dt=16.78.

  Calculate propagation constant and characteristic impedance

A transmission line has the following per-unit-length parameters: L = 0.5 H/m, C = 200 pF/m, R = 4.0 /m, and G = 0.02 S/m. Calculate the propagation constant and characteristic impedance of this line at 800 MHz. If the line is 30 cm long

  Calculate the inductive reactance per meter of single-phase

Calculate the inductive reactance per meter of a single-phase, 50-Hz, two-wire transmission line. Assume each conductor's radius is 3cm and the distance between the two conductors is 2m .

  Design the circuit to create pulse using j-k flip flops

moore sequential circuit has one input and one output, that creates a pulse when ever its input signal goes from 1 to 0 after this pulse a new pulse will not be given unless the input signal is again returned to 1 and then tranistion back to 0.

  What is bit rate of the transmission on the twisted pair

What is bit rate of the transmission on the twisted pair? If the digital outputs of three identical video cameras are combined onto a single cable using time division multiplexing, what is the bit rate on the cable?

  Calculate the first two energy levels

A one-dimensional infinite potential well with a width of 12 Ao contains an electron. (a) Calculate the first two energy levels that the electron may occupy. (b) If an electron drops from the second energy level to the first, what is the wavelengt..

  Explain construct a table showing the current for values

Construct a table showing the current for values of time between 0 and 9 hours at intervals of 1 hour.Hence draw a graph of i against t for 0 is smaller or equal to t is smaller or equal 9.(cannot type in proper inequality symbols)

  Calculate the value of the voltmeter resistor-rv

A simple voltmeter with a full-scale reading of 50(V) is required. Use a d'Arsonval movement with a rating of 20(mV) at 1 (mA). Calculate the value of the voltmeter resistor, Rv, required to achieve these design specifications.

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