Scale Factor wrong?
jeffrey morris
Posts: 52
I was following the project on page 162 of "What's A Micro Controller" book. The time values in the debug window are 331 and 937 instead of 500 and 1000. What's the correct scale factor?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
A. The original span is 607 (608 - 1) and the new span is 500 (1000 - 500).· The scale factor is:
···· new_span / old_span = 0.823
B. Convert 0.823 for use with */ by multiplying by 256; the result is 210
C. The conversion code, then, is:
··· newValue = rctVal */ 210 + 500
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
·· The code examples are not included at the request of educators who use these boards.· It forces the student to type in the code, improving learning from having to go through it.· As for a switch, the HomeWork Board goes to sleep when not in use, as long as you end programs with an END statement.· You only need to remove the battery when you're done with the board for the day.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com