A variable interval LED pulser??


Results 1 to 5 of 5

Threaded View

  1. #3
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    Couldn't you also do it without timer interrupts? Something like this perhaps (please excuse the C code)?
    Code:
    while(1)
    {
      period = adcin(3);             // read pot'
      period = period / 10 + 1;      // scale to 1..103 (seconds)
      count = 1;                     // start new period
      while(period < count)          //
      { delay_ms(1000);              // delay 1 second
        count++;                     // bump count var'
      }
      led = 1;                       // turn on led
      delay_us(500)                  // for 1/2 second
      led = 0;                       // and off
      delay_us(500)                  // for 1/2 second
    }
    You could use a circuit as simple as the "Spinning Class Strobe" (below) but you would need to change the potentiometer scale to represent a Period of 1 to 103 seconds.

    Regards, Mike
    Attached Images Attached Images  
    Last edited by Mike, K8LH; - 8th August 2010 at 16:15.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts