Question on Experiment 3 challenge 3 in WAM v. 1.5
Chris Drzewiecki
Posts: 26
I have version 1.5 of WAM and was going through the experiments.· I'm attaching a copy of my code for Challenge 3 of Experiment 3.· It's to make a servo go to one extreme, midpoint, back to same extreme the the other extreme.· Did I go about this the right way?· I'm only using the coding that was demonstrated up to exp. 3.
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Chris
Post Edited (Chris Drzewiecki) : 1/2/2006 6:07:20 AM GMT
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Chris
Post Edited (Chris Drzewiecki) : 1/2/2006 6:07:20 AM GMT
bs2
2K
Comments
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Chris
Before any of us answers your question, in an effort to avoid any embarrassment, are you looking for:
1. Yes, that will work
OR
2a. If I were wrinting the same program, I might have taken this approach ... .
2b. You can improve the speed of your code by implementing it like this ... .
2c. By doing ... so and so ... you can ... blah, blah, blah
I think you get the idea here.
No sense offering a critique, if one isn't really wanted
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Chris
I haven't checked this revised version for errors (of mine), but here's what I might have done (attached). Looks pretty good, if you ask me. Most of the changes I made were towards better self-documentation (a quirk of mine), and some comments on performance.
Regards,
Bruce Bates
Thanks for the tips and critiques. I was going to improve and correct the doc. after I get the logic and structure worked out. The new features and commands in 2.5 are great and thank you for pointing them out, since this version is based on 1.9. However I wrote this program based on what was covered in Experiments 1 -3 and most of the changes you made are further than what was taught. The code is not made to be efficient but to teach the principles and basics. That's why I think there are 1 second pauses in it to allow the student to easily observe what the servo is doing. So far in 1-3 it covered For-next loops, labels, GOTO, and variables structure wise. I do like how your code is more efficient, variables are better named, and better documented. I would of went beyond and looked up the syntax for other commands that I would normally use, such as constants, but I wanted to keep the program within the scope of what was covered. It's been a while since I programmed and wanted to get back into it and especially to hone my logic and structuring skills. I feel no opinion or criticism should be taken as an offense, but as a learning experience. There are many ways to do things and it's good to get other ideas because sometimes your brain gets stuck in one 'mode' so to speak. With that aside, is my logic and structure solid?
Thanks again for your help!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Chris
I obviously didn't look at the "lesson", but I see nothing wrong with the way you approached the problem. It's hard for me to say much more than that, when you somewhat limit what can be said by the comment that this was based "on what was covered in Experiments 1 -3", and nothing more is implied.
Perhaps I'm wrong, but I woudn't think any instructor would comdemn any program for using, or any student for reading, the supplied manual, and using what was found therein (at least I didn't when I taught). The only exception I can think of, is that it's often necessary to learn the "building block" approach of doing something, using a number of instructions or sub-routines, before you advance to using a more sophisticated, all-in-one command, which accomplishes the goal in one shot.
Whether you use the advanced features of it or not, I would consider using the latest version of the Parallax PBASIC Compiler. I can't think of any reason not to, and many reasons to do so. This is essentially true for any software which you might happen to use. This comes from my many YEARS in tech support
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Chris