Shop OBEX P1 Docs P2 Docs Learn Events
Beginner can't pass values between cogs — Parallax Forums

Beginner can't pass values between cogs

scidogscidog Posts: 4
edited 2009-10-20 14:36 in Propeller 1
Hello,

Looking at these two SPIN files, I (as a rank beginner) would say that they should do the same thing. That is, both spin files should flicker pins 4 and 6 hi/lo many times a second.

I am obviously so very wrong.

The attached "good" file works: The value for variable "ADCX" is utilized properly and the !outa[noparse]/noparse statements flicker the output pin states many times a second.


The bad file shows no errors, yet not a thing happens either.


All I want to do is pass the value from the first public method to the second for use.

This little example showcases a fundamental problem I have passing values between methods, let alone cogs.

I need to be able to pass global variables between methods, and for some reason I cannot see the attached bad code file does not.

Can anyone help?

Thanks,

scidog

Comments

  • mparkmpark Posts: 1,305
    edited 2009-10-20 14:36
    Execution starts with the first pub method. In "bad", the first pub is justholdvalue, which doesn't do very much.
Sign In or Register to comment.