How to use an object in main and in another object
henkvbeek
Posts: 11
I would like to do the following:
I want to use object "Simple_Serial" from main program and the same instance from "MyObj":
Main:
MyObj:
Now I get an error on the last line in "MyObj".
When I define the object "Simple_Serial" in "MyObj" I create a new instance.
I prefer to avoid this.
Is there anyone who can help me out.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What God wants, God gets . . .
I want to use object "Simple_Serial" from main program and the same instance from "MyObj":
Main:
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 OBJ Usart: "Simple_Serial" MyObj: "MyObject" PUB Start Usart.start(-1, 0, 19_200) Usart.str(string("Usart object started",13,10)) MyObj.start
MyObj:
PUB start WaitCnt(50_000_000 + Cnt) Usart.str("MyObj started",13,10))
Now I get an error on the last line in "MyObj".
When I define the object "Simple_Serial" in "MyObj" I create a new instance.
I prefer to avoid this.
Is there anyone who can help me out.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What God wants, God gets . . .
Comments
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What God wants, God gets . . .