Problem with spin tutorial
Siri
Posts: 220
Attached is the tutorila for the beginner by Dave Scanlan - EXAMPLE 07
I am new to spin and beginning to get the hang of it and liking it.
I tried to compile the above example 07 would not complie - the error was "expected "("·
At the line : PUB Start
·················· VideoDisplay.Start·· --> error line
since I was following the examples serially I noticed in a previous example the same call was made and it compiled with no errors. which
was because the line was : VideoDisplay.Start(12)
So when I edited the error to VideoDisplay(12) - the example· 07 compiled with no problem.
I would like someone to explain what "(12)" refering to and where 12 comes from.
I have seen that in the tutorials in the propeller manual but could not find the explanation for adding (12) after initializing the object.
Thank you.
Siri
I am new to spin and beginning to get the hang of it and liking it.
I tried to compile the above example 07 would not complie - the error was "expected "("·
At the line : PUB Start
·················· VideoDisplay.Start·· --> error line
since I was following the examples serially I noticed in a previous example the same call was made and it compiled with no errors. which
was because the line was : VideoDisplay.Start(12)
So when I edited the error to VideoDisplay(12) - the example· 07 compiled with no problem.
I would like someone to explain what "(12)" refering to and where 12 comes from.
I have seen that in the tutorials in the propeller manual but could not find the explanation for adding (12) after initializing the object.
Thank you.
Siri
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
this example uses a "sub-program"
all "sub-programs" in SPIN are called OBJECTS
in the code of this example there is a line
this means somehow "use the code of the file TV_terminal.SPIN"
inside this file TV_terminal.SPIN
you find a PUB
this means the function Start needs a parameter
(in this case this is the IO-PIN-number)
every call of the function start must be done with "(Nr)"
where Nr is the IO-PIN-Number
if start would be defined as
you would have to call
the numbers 567 and 945 are just supersilly examples with no sense
just to show the priciples of parameters
greeting
Stefan
video requires 4 pins ... which are assumed to be consecutive. 12 is sometimes called the start pin, because pins 12,13,14, and 15 are typically used.
You can actually use any four consecutive pins ... the lowest pin number is always the start pin and is always used in the function call.
Rich
Thank you very much for the in depth explanation.the previous reply -" just look in the code" did not explain where and why of the question.
I am very glad people like you are there to teach and explain these things to people like us who are not programmers and who are also intersted in learning but not just doing/writing code just because you see it done.
Thanks again,
Siri
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
you can ask as many questions as you like.
The examples and tutorials about SPIN are quite good.
If you know almost nothing about programming. The examples - sometimes - might be hard to understand.
So if you don't understand something feel free to ask it here.
The examples guess that you know something about the very basic princicples of programming
like
- parameter-donation,
- calling subroutines,
- variables,
- objective-programming,
- private and public subroutines
- global and local variables etc.
If you don't want to wait for forum answers all the time:
If you know nothing about these things - it might be useful to learn programming with a programming language like delphi or visual basic
(c; c++ are more difficult)
There are a lot of tutorials about delphi and visual basic.
90% of them are middle-class understandable
So start to read a tutorial. If you don't understand it - you are NOT too thumb - the tutorial is TOO BAD !
take the next one and check again. Repeat this until you find one that is really easy to understand.
Maybe you have to check 10 or 20 tutorials. But it is worth doing it - to find one that is REALLY EASY to understand.
I'm german and quite good in english. But judging about a programming-tutorial is hard for me
if you are german i might find a really easy to understand tutorial in german.
greetings
Stefan