View Full Version : led won't stay on

03-25-2012, 02:48 AM

......pretty basic but my led wont stay lit without a waitcnt or repeat ect. Shouldnt it stay lit until i tell the pin to go low?

Mike Green
03-25-2012, 02:52 AM
The reason the LED goes out is that there's an implied RETURN statement at the end of every method including the first (or only) one. The first (main) method in a program is actually called by the Spin interpreter initialization routine which sets up this return so it does a COGSTOP on the cog running your program and that clears all the I/O registers including DIRA making all the I/O pins into inputs.

03-25-2012, 02:53 AM
ok, that makes sense. thank you.-mike