linear1 forums
[part of the linear1 network]
+ [linear1 case mods]
+ [LED Center]
+ [privacy policy]
Welcome, Guest. Please login or register.
March 13, 2010, 06:10:14 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Login Register

linear1 forums  |  LED discussion  |  LED questions and discussion  |  Topic: How is it done? « previous next »
Pages: 1 2 [3] Print
Author Topic: How is it done?  (Read 34734 times)
jfmateos
Strong like bull
*
Offline Offline

Posts: 7


« Reply #30 on: March 07, 2008, 04:07:53 AM »

Hello again Drain...

I have changed my original 220 ohm resistor by a 220K one and the LED indeed discharges faster and glows less.



Logged
drain
Strong like bull
*
Offline Offline

Posts: 3


« Reply #31 on: March 10, 2008, 02:24:35 PM »

Hi.

This is the main loop, in PIC Basic Pro:

Code:
While true

   
      PORTB = 0x01 ' Led ON
   
      if (led=1) then
            Delay_ms(100)  'The led will stay ON for 100ms
      end if

      PORTB = 0x02 ' Led OFF
     
      if (led=0) then
            Delay_ms(100)
      end if
     
      TRISB.1 = 1  ' PORTB.1 as input

 
      while (PORTB.1=1) 

            ti = ti + 1

      wend
     
      TRISB.1 = 0  ' PORTB.1 as output

      if (ti>1700) then

         led=1    ' Turns LED on

      else
 
         led=0  ' Turns LED off

      end if
   
      Delay_ms(4)

 
wend

With this count limit (1700) I use a 1k Resistor in the led's anode.

My led is a high brilliant white led.

I'm going to test with different values for the resistor and the count limit.

Thanks
Logged
Pages: 1 2 [3] Print 
linear1 forums  |  LED discussion  |  LED questions and discussion  |  Topic: How is it done? « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.096 seconds with 20 queries.