It's a bit old but going back to something SRLM said up top -- you can most certainly have arrays of Prop objects. It can be very useful too.
And toward the end, Parallax has shown an uncanny genius for making it possible to do more more easily with less. I used stamps in side projects for years before I discovered the P8X32A. Sometimes you just need to get something simple and obvious done quickly, and you don't need to be learning a C library or going over complicated example code to figure out how to take in serial characters, rearrange them, and send them to an otherwise incompatible device.
Well, I can appreciate Heater's observation about keeping the initial burden low, and by doing so get some good programming understanding done with more people.
I'm writing some nice 6809 this weekend. Know what? I'm better at it now, and I know it's from seeing success on tougher projects on Propeller. In particular, I find I can jot code down now on a yellow pad, seeing more of the structures, and have that code be very close to working code.
Before, I would iterate through, sometimes just a bit at a time, often writing little things to vet other things, building this house of cards, slowly morphing it into something more substantial, hoping I don't break the magic on the way there. Now there is less of that, and that is good, and has revealed to me "the next level" and just seeing that, understanding how things go and what the product of it is, happens to be very self-motivating. It's now a question of how much work something is to get done, rather than a matter of it being within the scope of things that can be done.
Before, the appeal of actually doing something cool would drive me to complete the work. When there is less work, as there is on the Propeller, the expectation of "cool" goes up, and it's all rather sneaky. Soon, "cool" ends up something kind of nice, and it escalates...
So then, stepping back to an older reference showed me the product of that escalation, and it's a significant thing.
And I can tell you absolutely that much of the magic for me would have been lost without that simple prompt and interactivity. There are merits to this approach, and the minimal mental baggage one must carry to realize an idea is something where the product is simply more fluid ideas, and that's empowering at any level.
localroger said... ·Sometimes you just need to get something simple and obvious done quickly, and you don't need to be learning a C library or going over complicated example code to figure out how to take in serial characters, rearrange them, and send them to an otherwise incompatible device.
Exactly..... when you want to do a quick PROOF OF CONCEPT it is a lot easier to use something Quick and Simple and TRIED
so that you can·concentrate on the details of what you are doing instead of getting bogged down with so much other stuff
that will only serve to complicate things.
SamMishal said... BradC said...Life may be "too short", but it's the longest thing we ever do
Where do you keep coming up with these interesting sayings from???
Ahh, I wish I were witty enough to have come up with most of these little quotes, but alas most of them come from the deep dark recesses of my memory where I've read or heard them somewhere. This is why they are usually not attributed, as I'm stuffed if I can remember where most of them were sourced. Occasionally I'll put one of mine in there, but they are usually obvious by their mediocrity. I change them as my mood takes me [noparse]:)[/noparse]
A 10 second google search was unable to quickly locate the source of that one.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
I remember, that Chip said ('bout 1/2 year ago) that naming the "obejcts" object was a bad decision. Now he'd prefer calling them modules or something like this.
And with "module", things look quite different! And in fact, SPIN-objects resemble more the modules from Modula than the objects from C++ or whatever other (wannabee) OO-language.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.: YADRO
Hi Heater, · The anecdote you gave above about your son started me thinking. The example you used is good and it made him interested…..but…. imagine what you could have done in RobotBASIC instead of Python. · In RobotBASIC using the SIMULATED ROBOT you can make the student REALLY get excited. · Consider the following lesson where you would slowly build up a program one stage at a time….Compare the steps below to what you would get with a dry number crunching program. I am thinking about making it into a Youtube video similar to the one you liked about how to make a robot hug a contour using infrared sensors. · You would let the student type this program line rLocate 300,300 · Then run the program and see what happens…..then you have the student enter the next line rTurn 90 · Run and see what happens….notice the amusement on their faces….then type the next line rForward 100 · Then notice the excitement when they now run the program and see the final outcome. · ·
Now explain to them that the robot can DRAW on the floor…..have them type these two lines just under the first line (no need to explain the rInvisible line for now…just leave it for later) rInvisible Blue rPen Down · Explain the rPen Down line and that the Blue in the previous line is the color of the pen. Now have them run the program and see the real excitement….. · · Now ask them to think about what it would take to have the robot draw a SQUARE….then have them highlight the last two lines and then Copy them (Ctrl+C) then Paste them 3 times…..thus achieving the teaching of how to edit a program. The final program would like this ·
· Now when they run it (if they are anything like the people I have tried this on) you are going to get a GRIPPED class. · Now to make them appreciate the value of variables make them think about what it would take to make the square BIGGER or SMALLER…….let them change the number 100 and see how they are going to get bored with changing the number FOUR times. · Now·ask them to add the line SideLenth = 100 · At the top of the program and then delete all the rForward 100 lines and replace them with rForward SideLength · · Again using cutting and pasting and then have them change the number 100 to various values and run the program. Now they will definitely GET the need for variables. · Now again ask them what would be needed if we wanted to draw a Pentagon or a Hexagon or other Polygon shapes. Let them think about how they would need 5 or 6 or more repetitions of the two lines for turning and Forwarding…..Now show them this program ·
SideLength = 100
TurnAngle = 90
rLocate 300,300
rInvisible Blue
rPen Down
for n=1 to 4
rTurn TurnAngle
rForward SideLength
Next
·
Let them study it and EXPLAIN what it is doing. Let them analyze the two variables at the top. Let them analyze what the For-Loop is doing….have them explain the lines inside the for-loop and compare them to the previous final program they arrived at before……explain to them why we have them indented. · Now have them THINK about what is needed to make the Square become a Pentagon…..Now you have also made Algebra and Geometry·RELEVANT subjects. · Most will not appreciate straight away that the TrunAngle value has to be changed….have them try the program by just changing the For-Loop limit to 5 and then see what happens · Then explain why the TurnAngle has to be changed….let them think about and explain to them HOW to arrive at the value. Have them then change it and re-run the program….. have them explain and analyze the outcome. · Now introduce the following new program. Point their attention to the second and third lines. Ask them to explain how is that similar to what they have done above. Then let them analyze why this method is effective and how AGAIN variables are our friend. · Also spend sometime over the third line and explain the MATH and why it works. Point out that it is the SAME formula they used above to calculate the new TurnAngle value but now we are letting RB calculate it instead of them doing it and then typing the fixed number in the program. Let them explain the relationship to NumSides. ·
SideLength = 100
NumSides = 5
TurnAngle = 360/NumSides
rLocate 300,300
rInvisible Blue
rPen Down
for n=1 to NumSides
rTurn TurnAngle
rForward SideLength
Next
Have them change the SideLength and NumSides values to various settings and PLAY and ALSO have them try to ANTICIPATE what the outcome will be before running the program. · For a quick introduction to ERRORS have them change the SideLength value to some big number like 300 and then BEFORE they run the program to ANTICIPATE the outcome and then let them run it and EXPLAIN WHY the error occurred….ALSO have them spend some time READING the error message. · Have them notice how when the error dialog box is closed RB goes back to the edit screen and INDICATES the error causing line…..let them read it and EXPLAIN what happened. ·
As a final exercise…have the students think about and implement the ADDITIONAL code needed to make the robot move away from the drawn shape without of course drawing any more lines. ·
Notice how the final outcome of the whole process is that you have introduced the student to the following concepts
1-···· Programming
2-···· Program Editing
3-···· Variables
4-···· For loops
5-···· Need for indenting
6-···· Expressions
7-···· Errors in programming (no debugging yet)
8-···· Algebra
9-···· Geometry
10- Math ·
You may need·a couple of lessons instead of just one for younger students. ·
Notice how the programs do not have any EXTRANEOUS·and MEANINGLESS (to the student) syntax. Notice how the fact that RobotBASIC is an interpreter means they can repeatedly CHANGE-And-RUN with IMMEDIATE results and PAINLESS actions. ·
The Graphical results are AMUSING and GRIPPING thus maintaining a high level of interest and ENTHUSIASM. ·
The lesson has INDUCED the students to UTILIZE Math and Geometry and Algebra in a SUBTLE, AMUSING, MEMORABLE and TANGIBLE manner. · Note: The attached EXE is a compiled program that lets you choose which of the above three programs to run and then runs it. This way you can see the programs above running without using the RobotBASIC IDE if you do not want to use it. Also the image shows the final screen of the the third program.
A LOGO clone! Cool teaching tool. We used that in primary school all the time. I still have my 5.25" floppy with LOGO on it around somewhere and the original Apple LOGO manuals.
Still, if a kid was interested in Python...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
I have no idea what you did but ever since your last posting my browser now cannot reformat
the postings so as to fit the WIDTH of the browser window and now I have to SCROLL HORIZONTALLY
to see the postings......
I have seen this in other postings too.....it might be a setting or something.....
PLEASE....can you delete your posting and REPOST it with the correct settings so that this messed up
format is removed.....I don't know if this might fix it or not.....please try....
heater said...
I think the thing that blew him away about Python, apart from the shear simplicity of getting it to calculate anything, is that he could type
Sam, the only black boxes I have worked on in avionics were the Primary Flight Computers of the Boeing 777.
Heater, ·
I tried the above in RobotBASIC and it gives the result ······· 5.70552350097181e232
What does Python give??? Please try it and let me know...I do not have access to Python
right now and I am really interested.....thanks · ·
Now regarding the black box....do you mean ACTUALLY black??
The flight loggers for the all planes I know about 747 and down are bright
orange so that they can be easily located. I mean those recording devices
that record readings from all flight·instrumentation in a circular manner including
the conversation in the cockpit and are made to be virtually indestructible. ·
The 777 is fly by wire no??? the 757 too but the 747 is not. With the fly by wire
they perhaps do not need a recorder since the computer can be the recorder
or is that also still a separate function....it should be really if you want to do
it logically....do you know?
Leon said...
I just added some new lines. It should be OK now. The forum software is a bit dumb.
Leon
AAAHHHH.....THANK YOU Leon........this is MUCH better now..... ·
Leon....please go to the home page of the Propeller forum and locate a posting I made
about this problem.....PLEASE.....try to describe what is it that causes this anomaly.... ·
I think this will help others avoid this annoying problem.... ·
THANKS for fixing it.....
This post is interesting. I'm a newcomer to the Propeller, but I have used BasicX-24P (BasicStamp clones) for several years now. I have also been programming mostly in C for PIC and AVR. So far I think C is pretty good for writing codes for any embedded system, but I really do find Propeller objects fascinating because it reminds me so much of LabView. I think there's a lot of similarities between LabView "Vi" and Propeller "object". Neither are true object in programming sense and everyone is right that it's more of a black box (functions wrapper). Personally, I don't think OOP is appropriate for writing firmware codes anyway since the overhead to get things done would be a lot larger and the compiler would have to be a lot more sophisticated. Underneath the pretty Object classes, polymorphism, inheritance, etc., you still get the low level code underneath. OOP also removes you from truly understanding what's going on in the metal. If you are a comp. sci. person, then it doesn't really matter what's underneath, but for me as an EE I would like to know. After all, I do pick out the hardware and wires that go with the codes. OOP also makes you work a lot harder at coming up with the software structure in hopes of re-using your code. OOP is probably good for a large and complex project, but it also might discourage you from enjoying your project all together. Anyway, that's just my thoughts on the subject.
So far, I really like the support you can get from Parallax in terms of examples, schematics, and ideas. Everything is a lot more organized and easy to find. I think I'll be able to get my project up and running pretty quickly!
BradC said...Still, if a kid was interested in Python...
Hi Brad ·
How would a kid who knows nothing about programming GET TO BE interested in Python. How would he even know the difference between Python and a Cobra (wink wink nudge nudge )? ·
Why would a kid care which programming language he wants to be taught if he does not even know what a programming language is in any case? ·
It is not the kid that will have a preference since he does not know what to prefer in the first place. It is the teacher. ·
If I were to ask you which do you prefer A or B? You will rightfully ask me to explain what is A and what is B and even after I tell what they are if you still don’t know much about either then you LOGICALLY would tell me that you don’t know enough to be able to formulate a preference for either and that you need more information about both (actually most people do not have that kind of logical thinking anyway....that is what advertisers depend on). ·
Saying a kid who does not know anything about Python or Java and has never even programmed anything in anything will prefer Python over Java is the same as the above scenario. He does not know what or why or which to prefer since he does not know anything about programming altogether. ·
Let me illustrate to you the advantage of RobotBASIC and see if you could have done the same thing with Perl or Python or Java or C++ or C or ……choose any…. · I am actually making a challenge here….I would REALLY love to see a program written in any language that will do the same action as I am about describe and would serve the purpose RobotBASIC has served in the narrative below…..If anyone can do the program below in less time and less lines of code in any language I would be very very happy…please someone do it and show us the code…..it would be interesting to compare the results….I would dearly love it if some one would do that….in ANYTHING. ·
Here is what happened and how RobotBASIC was a GREAT aid in the situation...I think you will enjoy this: ·
A clever and good friend of mine·was convinced that the Moon does NOT Spin….i.e. rotate around its own axis. ·
His reason is that the moon while orbiting around the earth always presents the same face towards the earth and the only way for that to happen is if the moon does not spin. ·
I tried to convince him that the moon DOES spin·and·the reason it always presents the same face towards the earth is that it spins at the same rate as it orbits around the earth. ·
The earth spins around its axis in 24 hours. The moon on the other hand spins around its axis in around 28 days (+/- depending on which timing system you use). This also happens to be the same period for the moon to complete an orbit around the earth. ·
For the life of me I could not convince him even when I used props, that the above fact is the cause that the moon has a hidden side (hidden from earth bound people)….oh that dark and mysterious side of Luna that silvery beauty . ·
So I whipped out my laptop and fired up RB and within an hour I had a 64 lines simulation that allowed him to play with a moon and give it any rate of orbit and spin. ·
Then he had that WOW moment and he was finally convinced when he set the moon’s spin at the same rate as the orbit rate and saw how the same face was always presented towards the earth. He then tried different orbit and spin rates and saw how they made a difference. But the thing that clinched it in his mind·was when·he saw how that if there is no spin then the moon will actually NOT be presenting the same face to the earth. ·
This is interesting….the reason for him thinking that the moon does not spin turned out to be the one that convinced him most that the moon does spin…..HOW IRONIC…. ·
Well thanks to RB I was able to do that….. had I used ANY other language I would have needed MANY MORE lines of code than 64·and also MANY MORE HOURS than one. Also this is a demonstration for the power of simulations which RB can do quite readily even by inexperienced programmers and kids learning how to program. ··
The program is attached below…. The .BAS file is the source code if you would like to read it. The .EXE the compiled stand alone executable that you can run to play with the simulation. ·
I hope you would try it out….ESPECIALLY if you·know someone·who is not convinced that the moon does in fact spin about its own axis as well as orbiting around the earth….and both of course also orbit around the sun….just in case·someone out there does·not know that too·· …..REALLY….IT IS TRUE….despite what other sources might claim ...just ask Buzz Aldrin….he really DID go to the moon…again despite what other sources might claim….·· …. Unfortunately RB cannot help in proving that . ·
What comes to mind for me internally is "Procedures" that have "methods". Probably more confusion, but I thought I would toss that in to the mix.
LOGO is kind of great for first time programming. I taught it in High School on Apple computers and the students all had a great time. We did the usual geometric art, and some simple games, like a lunar lander type game. Each week, a new procedure would get tossed up on the overhead, sometimes two, depending. Everybody typed those in, then either ran them to observe, or added them to a body of code they were working on.
The class was kind of free form, in that if the required things got done, people were free to do their own thing. What they did most often was tie procedures together to do stuff that they wanted to do, that was kind of similar to the required things. Then they would modify procedures, finally writing their own.
One of the things that attracted me to the Propeller was it being to take that exact approach and see success in nice chunks, each either performing a task, or serving as a building block.
The nice thing about Python, LOGO, etc... are they run in their own little sandbox easily enough, and they can just execute a simple command directly. That's the one thing I miss from the Propeller experience, and clearly I'm not the only one as look at all the efforts to get that "just type it in and have it do something" environment running and viable and ideally practical.
For first time programming experiences, I like this because the guts of the computer are abstracted away, leaving people to get the idea of programs and data, and the idea of expressing their needs in discrete bits, in a structured way.
From there, having done the very basic things, variables, memory, logic, I/O, etc... they have some context to then take it down to the metal, or use something like what we have here on the Propeller.
The beauty of it here, is that SPIN files contain it all, and there isn't a lot of extra cruft, like one sees with things like the Arduino libraries, where dark, arcane magic is there for people to wield, but maybe not really understand. This environment tracks all the way down to the magic, with almost NO context changes, and that's as brilliant as it is practical.
IMHO, limiting context changes is a big deal for people wanting to learn stuff, because there is the learning of whatever is is, video beam, audio signal, pin toggle, PWM, servo, etc.... and there is the learning of the context, language, passed parameters, memory, structure, etc...
SPIN + PASM is very lean in this way, and it tracks all the way through to the core elements, with a minimum of "cruft" being necessary to do so. That lack of "cruft" inhibits more complex efforts made by experienced people, but it does not make them generally not possible, just a PITA sometimes. The split in tool chains we are seeing highlights this dynamic perfectly, also IMHO.
(editing, please stand by)
I also taught PASCAL. The difference was kind of stark. Where the LOGO students were encouraged to just do stuff, they generally did! They were rewarded with results more often than not too.
The PASCAL students would attempt this, but spent far more time sorting through the stuff and planning and trying to conceptualize, with the result being some more complex "just do stuff" efforts, but not anywhere near the number and diversity of them. Drop outs in PASCAL were higher than LOGO as well. I think the primary reason for this was it just not being as fun. One had to commit to a level of "getting serious" in order to see the joy, where the LOGO environment didn't really require that.
That's it, just wanted to put that compare / contrast out there.
Hi Firestorm.v1, ·
I am quite interested in a feed back from you regarding all the inputs all the good people (not including me of course) on this forum
have contributed. ·
Do you like Spin after all?
Do you now understand how Spin is object based/oriented or modular etc.? ·
I am sure others would be interested in what you thought about all this.....at least I am.
It would be nice to hear your opinion. You have been silent throughout the 51 postings. · ·
@Potatohead..... ah Pascal....I quite loved Pascal.... I never understood why it never caught on. I also like PL/I on the
mainframes...quite like Pascal. I could never quite fathom why would PL/I die off while Cobol is still alive??????
Why did Pascal die off and C is still popular? I can see why C would be popular....but why not Pascal TOO...??? ·
It is amazing how many languages have come and GONE....Modula 2 was another one of my favorites. ·
I just hope SPIN continues to be supported by Parallax and that it STAYS alive for a long time to come.
I think it is a very INNOVATIVE and capable as well as ENJOYABLE language to use. ·
Notice I chopped the lines up midway through the numbers with \ in ways that I don't think Python likes so
as not to blow up the width of this thread any more.
Looks like Robot BASIC is giving a correct answer as a float anyway.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
BradC: "Rumours of Pascal's death are greatly exaggerated."
Yes indeed. The main products of the startup I commenced working for recently are in Pascal. I guess mostly because they are the result of ten years or so of research development in academia where Pascal is much respected.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Well, well.... I did not know that.....good to know....I am glad that Pascal is still alive and
apparently thriving in the hands of many able people. ·
How do the compilers you use manage to interface with the windows API and other
things like the ActiveX and such? ·
Thanks for telling me. ·
Sorry Sam. More helpfully we use Free Pascal and the Lazarus IDE. www.lazarus.freepascal.org
With that your apps can run on Windows, Linux, Mac. Even cross compile for ARM, PowerPC etc.
I believe BradC uses that for BST as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
How do the compilers you use manage to interface with the windows API and other
things like the ActiveX and such?<o></o>
The same way all compilers do. Calls are translated into the relevant machine code with the right numbers in the right registers and a system call is made. (INT80 on x86 Linux for example)
Remember, these are compilers, not interpreters. They are generating bare metal code, so they can effectively do whatever they like (or the permissions set will let them).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
Comments
And toward the end, Parallax has shown an uncanny genius for making it possible to do more more easily with less. I used stamps in side projects for years before I discovered the P8X32A. Sometimes you just need to get something simple and obvious done quickly, and you don't need to be learning a C library or going over complicated example code to figure out how to take in serial characters, rearrange them, and send them to an otherwise incompatible device.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
Post Edited (SamMishal) : 1/10/2010 7:04:52 AM GMT
I'm writing some nice 6809 this weekend. Know what? I'm better at it now, and I know it's from seeing success on tougher projects on Propeller. In particular, I find I can jot code down now on a yellow pad, seeing more of the structures, and have that code be very close to working code.
Before, I would iterate through, sometimes just a bit at a time, often writing little things to vet other things, building this house of cards, slowly morphing it into something more substantial, hoping I don't break the magic on the way there. Now there is less of that, and that is good, and has revealed to me "the next level" and just seeing that, understanding how things go and what the product of it is, happens to be very self-motivating. It's now a question of how much work something is to get done, rather than a matter of it being within the scope of things that can be done.
Before, the appeal of actually doing something cool would drive me to complete the work. When there is less work, as there is on the Propeller, the expectation of "cool" goes up, and it's all rather sneaky. Soon, "cool" ends up something kind of nice, and it escalates...
So then, stepping back to an older reference showed me the product of that escalation, and it's a significant thing.
And I can tell you absolutely that much of the magic for me would have been lost without that simple prompt and interactivity. There are merits to this approach, and the minimal mental baggage one must carry to realize an idea is something where the product is simply more fluid ideas, and that's empowering at any level.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Safety Tip: Life is as good as YOU think it is!
so that you can·concentrate on the details of what you are doing instead of getting bogged down with so much other stuff
that will only serve to complicate things.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
·
Where do you keep coming up with these interesting sayings from???
This one is my favorite so far.....soooooo true....I love it...... My Comment on this one....not if God exists
I enjoy reading these mini-wisdoms of yours....very interesting....keep doing them.
Instead of Confucius Says.....we will one day be saying Brad Says....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
Post Edited (SamMishal) : 1/11/2010 8:15:39 AM GMT
Ahh, I wish I were witty enough to have come up with most of these little quotes, but alas most of them come from the deep dark recesses of my memory where I've read or heard them somewhere. This is why they are usually not attributed, as I'm stuffed if I can remember where most of them were sourced. Occasionally I'll put one of mine in there, but they are usually obvious by their mediocrity. I change them as my mood takes me [noparse]:)[/noparse]
A 10 second google search was unable to quickly locate the source of that one.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
Sorry...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
Hello Rest Of The World
Hello Debris
Install a propeller and blow them away
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
And with "module", things look quite different! And in fact, SPIN-objects resemble more the modules from Modula than the objects from C++ or whatever other (wannabee) OO-language.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
·
The anecdote you gave above about your son started me thinking. The example you used is good and it made him interested…..but…. imagine what you could have done in RobotBASIC instead of Python.
·
In RobotBASIC using the SIMULATED ROBOT you can make the student REALLY get excited.
·
Consider the following lesson where you would slowly build up a program one stage at a time….Compare the steps below to what you would get with a dry number crunching program. I am thinking about making it into a Youtube video similar to the one you liked about how to make a robot hug a contour using infrared sensors.
·
You would let the student type this program line
rLocate 300,300
·
Then run the program and see what happens…..then you have the student enter the next line
rTurn 90
·
Run and see what happens….notice the amusement on their faces….then type the next line
rForward 100
·
Then notice the excitement when they now run the program and see the final outcome.
·
·
Now explain to them that the robot can DRAW on the floor…..have them type these two lines just under the first line (no need to explain the rInvisible line for now…just leave it for later)
rInvisible Blue
rPen Down
·
Explain the rPen Down line and that the Blue in the previous line is the color of the pen. Now have them run the program and see the real excitement…..
·
·
Now ask them to think about what it would take to have the robot draw a SQUARE….then have them highlight the last two lines and then Copy them (Ctrl+C) then Paste them 3 times…..thus achieving the teaching of how to edit a program. The final program would like this
·
·
Now when they run it (if they are anything like the people I have tried this on) you are going to get a GRIPPED class.
·
Now to make them appreciate the value of variables make them think about what it would take to make the square BIGGER or SMALLER…….let them change the number 100 and see how they are going to get bored with changing the number FOUR times.
·
Now·ask them to add the line
SideLenth = 100
·
At the top of the program and then delete all the rForward 100 lines and replace them with
rForward SideLength
·
·
Again using cutting and pasting and then have them change the number 100 to various values and run the program. Now they will definitely GET the need for variables.
·
Now again ask them what would be needed if we wanted to draw a Pentagon or a Hexagon or other Polygon shapes.
Let them think about how they would need 5 or 6 or more repetitions of the two lines for turning and Forwarding…..Now show them this program
·
·
Let them study it and EXPLAIN what it is doing. Let them analyze the two variables at the top. Let them analyze what the For-Loop is doing….have them explain the lines inside the for-loop and compare them to the previous final program they arrived at before……explain to them why we have them indented.
·
Now have them THINK about what is needed to make the Square become a Pentagon…..Now you have also made Algebra and Geometry·RELEVANT subjects.
·
Most will not appreciate straight away that the TrunAngle value has to be changed….have them try the program by just changing the For-Loop limit to 5 and then see what happens
·
Then explain why the TurnAngle has to be changed….let them think about and explain to them HOW to arrive at the value. Have them then change it and re-run the program….. have them explain and analyze the outcome.
·
Now introduce the following new program. Point their attention to the second and third lines. Ask them to explain how is that similar to what they have done above. Then let them analyze why this method is effective and how AGAIN variables are our friend.
·
Also spend sometime over the third line and explain the MATH and why it works. Point out that it is the SAME formula they used above to calculate the new TurnAngle value but now we are letting RB calculate it instead of them doing it and then typing the fixed number in the program. Let them explain the relationship to NumSides.
·
Have them change the SideLength and NumSides values to various settings and PLAY and ALSO have them try to ANTICIPATE what the outcome will be before running the program.
·
For a quick introduction to ERRORS have them change the SideLength value to some big number like 300 and then BEFORE they run the program to ANTICIPATE the outcome and then let them run it and EXPLAIN WHY the error occurred….ALSO have them spend some time READING the error message.
·
Have them notice how when the error dialog box is closed RB goes back to the edit screen and INDICATES the error causing line…..let them read it and EXPLAIN what happened.
·
As a final exercise…have the students think about and implement the ADDITIONAL code needed to make the robot move away from the drawn shape without of course drawing any more lines.
·
Notice how the final outcome of the whole process is that you have introduced the student to the following concepts
1-···· Programming
2-···· Program Editing
3-···· Variables
4-···· For loops
5-···· Need for indenting
6-···· Expressions
7-···· Errors in programming (no debugging yet)
8-···· Algebra
9-···· Geometry
10- Math
·
You may need·a couple of lessons instead of just one for younger students.
·
Notice how the programs do not have any EXTRANEOUS·and MEANINGLESS (to the student) syntax. Notice how the fact that RobotBASIC is an interpreter means they can repeatedly CHANGE-And-RUN with IMMEDIATE results and PAINLESS actions.
·
The Graphical results are AMUSING and GRIPPING thus maintaining a high level of interest and ENTHUSIASM.
·
The lesson has INDUCED the students to UTILIZE Math and Geometry and Algebra in a SUBTLE, AMUSING, MEMORABLE and TANGIBLE manner.
·
Note: The attached EXE is a compiled program that lets you choose which of the above three programs to run and then runs it. This way you can see the programs above running without using the RobotBASIC IDE if you do not want to use it. Also the image shows the final screen of the the third program.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
Post Edited (SamMishal) : 1/12/2010 5:48:48 AM GMT
Still, if a kid was interested in Python...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
and get a result!
Sam, the only black boxes I have worked on in avionics were the Primary Flight Computers of the Boeing 777.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
(define a 123456789123456789123456789123456789123456789)
(define a (* a a))
(* a a a a a a a a)
generates:
291232368131908732349347179770745865015001971850912701429497306495026139108634859787384418037743684187913835815057
1988105693688213345276839345797271058844921817155684519795406100326833511640731241896475290527359456742496516711
2137601837579892642429535260826104538136997775882743377250337267988446385091079203551828082587755353728146106840
4587456775399024738865658671617362456408220346320542389960213650105721142069130661012749506656590233797763963868
5125996504977021138228508442254250114115216905511007465521820026724322135033270267169475216920260233336059694454
6986797655088117511299239041205266914652678342493257597344431297449585425016159753168884232827716760233137811701
61944396124494780053198126343361
I actually used PLT Scheme.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Post Edited (Leon) : 1/12/2010 5:34:17 PM GMT
I have no idea what you did but ever since your last posting my browser now cannot reformat
the postings so as to fit the WIDTH of the browser window and now I have to SCROLL HORIZONTALLY
to see the postings......
I have seen this in other postings too.....it might be a setting or something.....
PLEASE....can you delete your posting and REPOST it with the correct settings so that this messed up
format is removed.....I don't know if this might fix it or not.....please try....
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
Post Edited (SamMishal) : 1/12/2010 5:49:05 PM GMT
·
I tried the above in RobotBASIC and it gives the result
······· 5.70552350097181e232
What does Python give??? Please try it and let me know...I do not have access to Python
right now and I am really interested.....thanks
·
·
Now regarding the black box....do you mean ACTUALLY black??
The flight loggers for the all planes I know about 747 and down are bright
orange so that they can be easily located. I mean those recording devices
that record readings from all flight·instrumentation in a circular manner including
the conversation in the cockpit and are made to be virtually indestructible.
·
The 777 is fly by wire no??? the 757 too but the 747 is not. With the fly by wire
they perhaps do not need a recorder since the computer can be the recorder
or is that also still a separate function....it should be really if you want to do
it logically....do you know?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
·
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
·
Leon....please go to the home page of the Propeller forum and locate a posting I made
about this problem.....PLEASE.....try to describe what is it that causes this anomaly....
·
I think this will help others avoid this annoying problem....
·
THANKS for fixing it.....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
·
So far, I really like the support you can get from Parallax in terms of examples, schematics, and ideas. Everything is a lot more organized and easy to find. I think I'll be able to get my project up and running pretty quickly!
·
How would a kid who knows nothing about programming GET TO BE interested in Python. How would he even know the difference between Python and a Cobra (wink wink nudge nudge )?
·
Why would a kid care which programming language he wants to be taught if he does not even know what a programming language is in any case?
·
It is not the kid that will have a preference since he does not know what to prefer in the first place. It is the teacher.
·
If I were to ask you which do you prefer A or B? You will rightfully ask me to explain what is A and what is B and even after I tell what they are if you still don’t know much about either then you LOGICALLY would tell me that you don’t know enough to be able to formulate a preference for either and that you need more information about both (actually most people do not have that kind of logical thinking anyway....that is what advertisers depend on).
·
Saying a kid who does not know anything about Python or Java and has never even programmed anything in anything will prefer Python over Java is the same as the above scenario. He does not know what or why or which to prefer since he does not know anything about programming altogether.
·
Let me illustrate to you the advantage of RobotBASIC and see if you could have done the same thing with Perl or Python or Java or C++ or C or ……choose any….
·
I am actually making a challenge here….I would REALLY love to see a program written in any language that will do the same action as I am about describe and would serve the purpose RobotBASIC has served in the narrative below…..If anyone can do the program below in less time and less lines of code in any language I would be very very happy…please someone do it and show us the code…..it would be interesting to compare the results….I would dearly love it if some one would do that….in ANYTHING.
·
Here is what happened and how RobotBASIC was a GREAT aid in the situation...I think you will enjoy this:
·
A clever and good friend of mine·was convinced that the Moon does NOT Spin….i.e. rotate around its own axis.
·
His reason is that the moon while orbiting around the earth always presents the same face towards the earth and the only way for that to happen is if the moon does not spin.
·
I tried to convince him that the moon DOES spin·and·the reason it always presents the same face towards the earth is that it spins at the same rate as it orbits around the earth.
·
The earth spins around its axis in 24 hours. The moon on the other hand spins around its axis in around 28 days (+/- depending on which timing system you use). This also happens to be the same period for the moon to complete an orbit around the earth.
·
For the life of me I could not convince him even when I used props, that the above fact is the cause that the moon has a hidden side (hidden from earth bound people)….oh that dark and mysterious side of Luna that silvery beauty .
·
So I whipped out my laptop and fired up RB and within an hour I had a 64 lines simulation that allowed him to play with a moon and give it any rate of orbit and spin.
·
Then he had that WOW moment and he was finally convinced when he set the moon’s spin at the same rate as the orbit rate and saw how the same face was always presented towards the earth. He then tried different orbit and spin rates and saw how they made a difference. But the thing that clinched it in his mind·was when·he saw how that if there is no spin then the moon will actually NOT be presenting the same face to the earth.
·
This is interesting….the reason for him thinking that the moon does not spin turned out to be the one that convinced him most that the moon does spin…..HOW IRONIC….
·
Well thanks to RB I was able to do that….. had I used ANY other language I would have needed MANY MORE lines of code than 64·and also MANY MORE HOURS than one. Also this is a demonstration for the power of simulations which RB can do quite readily even by inexperienced programmers and kids learning how to program.
··
The program is attached below…. The .BAS file is the source code if you would like to read it. The .EXE the compiled stand alone executable that you can run to play with the simulation.
·
I hope you would try it out….ESPECIALLY if you·know someone·who is not convinced that the moon does in fact spin about its own axis as well as orbiting around the earth….and both of course also orbit around the sun….just in case·someone out there does·not know that too·· …..REALLY….IT IS TRUE….despite what other sources might claim ...just ask Buzz Aldrin….he really DID go to the moon…again despite what other sources might claim….·· …. Unfortunately RB cannot help in proving that .
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
Post Edited (SamMishal) : 1/18/2010 4:33:59 PM GMT
What comes to mind for me internally is "Procedures" that have "methods". Probably more confusion, but I thought I would toss that in to the mix.
LOGO is kind of great for first time programming. I taught it in High School on Apple computers and the students all had a great time. We did the usual geometric art, and some simple games, like a lunar lander type game. Each week, a new procedure would get tossed up on the overhead, sometimes two, depending. Everybody typed those in, then either ran them to observe, or added them to a body of code they were working on.
The class was kind of free form, in that if the required things got done, people were free to do their own thing. What they did most often was tie procedures together to do stuff that they wanted to do, that was kind of similar to the required things. Then they would modify procedures, finally writing their own.
One of the things that attracted me to the Propeller was it being to take that exact approach and see success in nice chunks, each either performing a task, or serving as a building block.
The nice thing about Python, LOGO, etc... are they run in their own little sandbox easily enough, and they can just execute a simple command directly. That's the one thing I miss from the Propeller experience, and clearly I'm not the only one as look at all the efforts to get that "just type it in and have it do something" environment running and viable and ideally practical.
For first time programming experiences, I like this because the guts of the computer are abstracted away, leaving people to get the idea of programs and data, and the idea of expressing their needs in discrete bits, in a structured way.
From there, having done the very basic things, variables, memory, logic, I/O, etc... they have some context to then take it down to the metal, or use something like what we have here on the Propeller.
The beauty of it here, is that SPIN files contain it all, and there isn't a lot of extra cruft, like one sees with things like the Arduino libraries, where dark, arcane magic is there for people to wield, but maybe not really understand. This environment tracks all the way down to the magic, with almost NO context changes, and that's as brilliant as it is practical.
IMHO, limiting context changes is a big deal for people wanting to learn stuff, because there is the learning of whatever is is, video beam, audio signal, pin toggle, PWM, servo, etc.... and there is the learning of the context, language, passed parameters, memory, structure, etc...
SPIN + PASM is very lean in this way, and it tracks all the way through to the core elements, with a minimum of "cruft" being necessary to do so. That lack of "cruft" inhibits more complex efforts made by experienced people, but it does not make them generally not possible, just a PITA sometimes. The split in tool chains we are seeing highlights this dynamic perfectly, also IMHO.
(editing, please stand by)
I also taught PASCAL. The difference was kind of stark. Where the LOGO students were encouraged to just do stuff, they generally did! They were rewarded with results more often than not too.
The PASCAL students would attempt this, but spent far more time sorting through the stuff and planning and trying to conceptualize, with the result being some more complex "just do stuff" efforts, but not anywhere near the number and diversity of them. Drop outs in PASCAL were higher than LOGO as well. I think the primary reason for this was it just not being as fun. One had to commit to a level of "getting serious" in order to see the joy, where the LOGO environment didn't really require that.
That's it, just wanted to put that compare / contrast out there.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 1/13/2010 5:14:33 PM GMT
·
I am quite interested in a feed back from you regarding all the inputs all the good people (not including me of course) on this forum
have contributed.
·
Do you like Spin after all?
Do you now understand how Spin is object based/oriented or modular etc.?
·
I am sure others would be interested in what you thought about all this.....at least I am.
It would be nice to hear your opinion. You have been silent throughout the 51 postings.
·
·
@Potatohead..... ah Pascal....I quite loved Pascal.... I never understood why it never caught on. I also like PL/I on the
mainframes...quite like Pascal. I could never quite fathom why would PL/I die off while Cobol is still alive??????
Why did Pascal die off and C is still popular? I can see why C would be popular....but why not Pascal TOO...???
·
It is amazing how many languages have come and GONE....Modula 2 was another one of my favorites.
·
I just hope SPIN continues to be supported by Parallax and that it STAYS alive for a long time to come.
I think it is a very INNOVATIVE and capable as well as ENJOYABLE language to use.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
·
Rumours of Pascal's death are greatly exaggerated.
Let's look at some applications most of us will be familiar with, shall we?
Propeller Tool : Pascal
Propellent : Pascal
bst : Pascal
PropBasic : Pascal
Noticing a trend here?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
Notice I chopped the lines up midway through the numbers with \ in ways that I don't think Python likes so
as not to blow up the width of this thread any more.
Looks like Robot BASIC is giving a correct answer as a float anyway.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I spent a long time working for GEC Avionics in England testing the 777 PFC's. They were definitely black boxes about one cubic foot.
I could not find any pictures of them but you can read about them in the attachment
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Yes indeed. The main products of the startup I commenced working for recently are in Pascal. I guess mostly because they are the result of ten years or so of research development in academia where Pascal is much respected.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
apparently thriving in the hands of many able people.
·
How do the compilers you use manage to interface with the windows API and other
things like the ActiveX and such?
·
Thanks for telling me.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
With that your apps can run on Windows, Linux, Mac. Even cross compile for ARM, PowerPC etc.
I believe BradC uses that for BST as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
The same way all compilers do. Calls are translated into the relevant machine code with the right numbers in the right registers and a system call is made. (INT80 on x86 Linux for example)
Remember, these are compilers, not interpreters. They are generating bare metal code, so they can effectively do whatever they like (or the permissions set will let them).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.