Shop OBEX P1 Docs P2 Docs Learn Events
Cognew with two objects — Parallax Forums

Cognew with two objects

CenlasoftCenlasoft Posts: 265
edited 2009-08-05 21:42 in Propeller 1
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)

Comments

  • TimmooreTimmoore Posts: 1,031
    edited 2009-08-03 03:17
    Several problems
    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.
  • CenlasoftCenlasoft Posts: 265
    edited 2009-08-05 21:42
    Thanks Timmoore

    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)
Sign In or Register to comment.