Shop OBEX P1 Docs P2 Docs Learn Events
Interrupts — Parallax Forums

Interrupts

edgellmhedgellmh Posts: 85
edited 2008-06-10 19:44 in General Discussion
Is there a way to do interrupts with the javelin stamp as there is with the SX chip? I want to have a light blinking in the background while the main loop is doing things that take lots of time.

marshall edgell

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-06-10 14:42
    There are no interrupts but you can use PWM to generate a (square)wave signal
    in the background.
    If you select
    static int highTime = (short)57600;
    static·int lowTime = (short)57600;
    you should get a pulsing led (0.499968 sec off, 0.499968 sec on)

    static PWM led = new PWM(CPU.pin12,highTime,lowTime);

    Put a 470 ohm resistor in series with the led.

    regards peter
  • edgellmhedgellmh Posts: 85
    edited 2008-06-10 19:44
    Clever.

    marshall
Sign In or Register to comment.