Objects and Cogs
Kokovec
Posts: 14
Here's a newbie question...
Is it possible to initialize a cog in one object and then access that same cog in another object?
For instance:
"Main" object starts SPI object in COG1
"Client" object uses SPI object in COG1 to send out a byte.
I'm sure this has been iscussed before but I have not been able to find a thread to answer this question.
·
Is it possible to initialize a cog in one object and then access that same cog in another object?
For instance:
"Main" object starts SPI object in COG1
"Client" object uses SPI object in COG1 to send out a byte.
I'm sure this has been iscussed before but I have not been able to find a thread to answer this question.
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
What about if I wanted to use an object from the library.
Can I start COG1 in "Main" with the TV_Text object and then have the "Client" object send out a character using the same COG?
Does that make sense?
Dan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
Thanks for your help!
Dan
As one who is just learning the Spin language, I have a question about
some of the syntax you used in xObjectTest.spin.
The ascii strings, "Hello", "Hello1" and "Hello2" are followed by
sd.
What is the significance of sd?
I thought the text string was supposed to be terminated by zero.
phil
Syntax for string(...) allows all kinds of constants in any order i.e. string("line",$d,"newline",$9,"tabbed word",$d).
It's kind of like "character-coding" .... In the case of TV_Text.str(...) codes can be used to change colors or
reposition characters, etc... since the str() method calls out() and out "interprets" the character codes (ASCII).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
Thanks.
When I first looked at it in the Propeller Tool, it was hard to see
that the character was a dollar sign and not simply 's'. Makes sense
now.
phil