Shop OBEX P1 Docs P2 Docs Learn Events
led won't stay on — Parallax Forums

led won't stay on

mikeamikea Posts: 283
edited 2012-03-24 19:53 in Propeller 1
dira[4]~~
outa[4]~~

......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?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-24 19:52
    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.
  • mikeamikea Posts: 283
    edited 2012-03-24 19:53
    ok, that makes sense. thank you.-mike
Sign In or Register to comment.