totalspectrum / flexprop

Simple GUI for Propeller development (both P1 and P2)
Other
38 stars 15 forks source link

Small timing tweak in `blink_all_cogs.spin` #80

Closed SomeInterestingUserName closed 1 year ago

SomeInterestingUserName commented 1 year ago

I think this example program (samples/blink_all_cogs.spin) is a nice and simple Propeller-specific demo that shows off its multicore capabilities.

However, I noticed that the P16/17 (on the P1) or P56/57 (on the P2) LEDs blink at the same rate. I believe the intended effect is to have all eight LEDs blink at different rates to visually demonstrate that they are independently controlled.

My suggestion would be to swap lines 28 and 29, so that delay gets decremented after a cog is launched in the loop. This will ensure the main cog blinks its LED at a different frequency than the second-to-last cog. This also lets the first cog blink its LED at a nice round 0.5 Hz.

totalspectrum commented 1 year ago

Thank you, that is an excellent idea. I've updated the sample source code in github.