The basic stamp works only with integers – A.) What does this mean? B.) What lim
ID: 3575033 • Letter: T
Question
The basic stamp works only with integers – A.) What does this mean? B.) What limitations does it impose in programming? You wish to control a 10 Amp motor with the basic stamp – it is a DC motor. You would like to stop the motor and control it so that clockwise and counter clockwise can be selected. What would the schematic look – show specifically how you would interface this into the BS2p and what would the program look like with three switch selections of run, Clockwise, Counter-Clockwise. Assume that if run is not selected the unit will stop. Discuss the various serial protocols supported by the BS2p. Suppose you wished to implement a clock reference in the BS2p but you were so far away from a window inside a large building that there were no GPS signals reaching the antenna. Your new boss hands you a DS1302 and says “make this work” – show how to interface this to the BS2p with a hand drawn schematic or Multisim. What might a simple program look like to display seconds since a button press on the serial display. Where I have asked you what might the code look like in question 2 and 4 for a given task – you may write this by hand, write it with the PBASIC. It does not have to be a working program; I simply want to see how you would code the program – your best guess of what would work on the first attempt. Many times programmers use simulation software to see how code will behave before it is every installed on hardware such as a PIC.
Explanation / Answer
The basic stamp works only with integers – A.) What does this mean?
It means we can perform math operation using Integer number or variable only no fractions are allowed. for example if we write BASIC STAMP to divide 5 by 2 it will gives the result in integer form i.e. 2 not 2.5 if loss the remainder.5
B.) What limitations does it impose in programming?
Due to supportation of fraction by BASIC STAMP, no one can implement the mathematical calculation on exact value.
The BASIC Stamp can only handle whole integer numbers. Therefore, methods of conversion to integer numbers is necessary depending on your exact needs. For the expression: F = 1.8 * C + 32 can be re-written as F = 18 * C + 320. This conversion however means that the actual result 1/10th of the result obtained from the calculation.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.