Cognew with two objects
Cenlasoft
Posts: 265
Hello,
I am trying to:
1. Use an AD0831 to measure a voltage
2. Start a squarewave on a new cog
3. View the results with ViewPort.
1 and 3 work great. When I put 2 in the code, My prop demo baord goes crazy, all LEDs light up. I called Parallax tech support and was told they would email me a possible solution, but no word since thursday.
I have attached the two modified objects:
Thanks,
Cenlasoft (curtis)
I am trying to:
1. Use an AD0831 to measure a voltage
2. Start a squarewave on a new cog
3. View the results with ViewPort.
1 and 3 work great. When I put 2 in the code, My prop demo baord goes crazy, all LEDs light up. I called Parallax tech support and was told they would email me a possible solution, but no word since thursday.
I have attached the two modified objects:
Thanks,
Cenlasoft (curtis)
spin
9K
Comments
1. You can't do a cognew of a functon in a different object, so split the call, add a pri function that calls sqw.freq
2.But thats not going to work since freq starts the squareware as counters and returns then the cog exits and the counters stop
So just call sqw.Freq directly from initialize its set up the counters and returns.
I understand how to do it now. I combined all the methods or procedure into one spin file and made the calls with one cognew statement. Its working great with the prop and viewport.
Thanks,
Cenlasoft (Curtis)