Starting and stopping a cog with a push button
mattbutsko
Posts: 8
Alright, so I've read over the Methods and Cogs chapter in PE Kit Labs but I can't seem to find a solid sample code to work with to make what i want to happen. basically, can someone give me a basic sample code for having a cog run, then when you push a button/flip a switch, the cog disables until the switch is let go of again.
I just can't seem to be able to use cogstop() properly. sorry about the grammar, i'm typing on my phone. thanks for taking a look.
I just can't seem to be able to use cogstop() properly. sorry about the grammar, i'm typing on my phone. thanks for taking a look.
Comments
To pause until a switch changes state, you'd want to use WAITPEQ or WAITPNE. Look up the explanations in the Propeller Manual.
Andy
Thanks everyone, but specifically Andy for the example. I can definately build what I need out of this.