Quick and dirty candle effect with PIC12F675


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2011
    Location
    Guadalajara, México
    Posts
    28

    Default Quick and dirty candle effect with PIC12F675

    For best results use a clear amber LED, you can embbed the LED using a tube as cast and pouring molten parafin...

    Code:
    '****************************************************************
    '*  Name    : RGB12F675                                         *
    '*  Author  : Ivan Rosales, Guadalajara México                  *
    '*  Notice  : Copyright (c) 2011 Ivan Rosales                   *
    '*          : All Rights Reserved                               *
    '*  Date    : 31/08/2011                                        *
    '*  Version : 1.0                                               *
    '*  Notes   : Efecto de Vela en Pin 5 (GP2)                     *
    '*          : Utilizar preferentemente LED Ambar                *
    '****************************************************************
    @ Device PIC12F675,WDT_ON,PWRT_ON,PROTECT_OFF,MCLR_OFF,BOD_OFF
    ansel=0             'No usar ADC's las entradas serán digitales
    cmcon=7             'No usar comparadores analógicos
    trisio=%001011      'GP2 Será salida
    DEFINE OSCCAL_1K 1  'Auto-Calibración del reloj interno 
    
    'Definiciones
    Vela var GPIO.2
    Luz var byte
    X var byte
    Ciclos con 25
    
    'Programa
    Pral:
    random luz
    luz=luz//(255-ciclos)
    if luz<120 then luz=luz+50
    for x=1 to ciclos
    pwm vela, luz+x, 1
    next
    goto pral
    end

  2. #2
    Join Date
    Apr 2003
    Location
    Cambridge - UK
    Posts
    1,030


    Did you find this post helpful? Yes | No

    Default Re: Quick and dirty candle effect with PIC12F675

    Thanks for your code example. It would be great if you could include a schematic. Because there is no shematic i cant put this in the User Projects section, but i have put the code example in the wiki here

    Thank you for your contribution

  3. #3
    Join Date
    Aug 2011
    Location
    Guadalajara, México
    Posts
    28


    Did you find this post helpful? Yes | No

    Default Re: Quick and dirty candle effect with PIC12F675

    The schematic could not be more simple
    As an alternative you can omit the switch and use an old USB cable to provide the the 5vdc (usually RED cable) and the Ground (usually BLACK cable) this way you can have a romantic companion for your computer...

    Code:
    5vdc (Vdd)
        +          PIC12F675
        |    _/       ___
        '--o/  o----o|°  |o------------------.
                   -o|   |o-  Amber (Clear)  |
                   -o|   |o-     LED         |
                   -o|___|o------>|----------o
                                            |
                                            |
                                           ===
                                           GND

Members who have read this thread : 1

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