Runing the same object in 2 different cogs?
reppig
Posts: 35
I am writing a program to read in GPS data from a balloon and convert it to AZ and EZ and then command a computer controlled antenna rotor to move the antenna to stay pointed at the balloon.
I have everything working except for the commanding of the antenna rotor. I am using FullDuplexSerial.spin running in a seperate cog to read the GPS data coming in.
I would like to run FullDuplexSerial.spin in a different cog just to command the antenna rotors.
Since FullDuplexSerial.spin has a start call. Can I call it again with different parameter and expect it to start in a new cog? What is the best way of do this?
Thanks in advance.
I have everything working except for the commanding of the antenna rotor. I am using FullDuplexSerial.spin running in a seperate cog to read the GPS data coming in.
I would like to run FullDuplexSerial.spin in a different cog just to command the antenna rotors.
Since FullDuplexSerial.spin has a start call. Can I call it again with different parameter and expect it to start in a new cog? What is the best way of do this?
Thanks in advance.
Comments
There is also a 4 port serial object in Obex that a number of people are successfully using. I am unsure of its name as I have not used it.
BTW I understand that the altitude is not that accurate for GPS, so are you relaying separate altitude data? For example, I often noticed while sailing in the ocean, that my altitude was not zero.
This creates two separate instances. But, if your GPS interface is read-only, and your antenna interface is write-only, you can use the same instance to do both jobs. Just assign the input and output pins accordingly.
-Phil
It is not necessary (nor would it even help) to create two copies of FullDuplexSerial. The reason it's not necessary is that all the object's hub variables are declared as VARs, which are duplicated for each declared instance. The reason it would not help is that the compiler detects identical objects and discards duplicates.
-Phil
-Phil
Thanks for you help.
I usually work with PIC processors and that forum is just OK and slow with answers.
I am going to move away from PIC's. Thanks again.