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?
Thanks, Jon. I think that the code on page 162 is wrong - it's missing the "time = time */ 185" line. This line is in the code on page 156. The CD-ROM doesn't have source code for the "What's A Micro Controller?" book that came with starter kit with the Home Work Board. The Home Work Board should have an on/off switch for the 9-volt battery.
·· 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
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