Did you find this site useful ? Please
to help www.micro-examples.com

If you need a coder or a freelance programmer, submit your project to me


LED Blinking Example

Printer-friendly version | Forums | FAQs |

TEST NAME

NOM DU TEST

LED Blinking Clignotement de LEDs

DESCRIPTION

DESCRIPTION

Basic PIC test :
Forever, turns PORTB high during 500 ms, then low during 500 ms.

Test de base du PIC :
Indéfiniment, met à 1 tous les bits du PORTB pendant 500 ms, puis à 0 pendant 500 ms.

RELEASE/DATE

VERSION/DATE

V1.0 september 2006 V1.0 septembre 2006

TESTED PIC FUNCTIONS

FONCTIONS du PIC TESTEES

Oscillator/Clock
PORTB outputs
Oscillateur/Horloge
Sorties du PORTB

MikroC SOURCE CODE

CODE SOURCE MikroC

/*
 * LED BLINKING Example
 * Author : Bruno Gavand
 * Compiler : mikroC V6.0
 * Date : september, 2006
 * Release : 1.0
 *
 * this program toggles PORTB outputs
 *
 * see more details on http://www.micro-examples.com
 *
 */
 
void main()
        {
        TRISB = 0 ;     // set PORTB as OUTPUT

        for(;;)         // forever
                {
                PORTB = 0xff ;          // turn all LEDs ON
                Delay_ms(500) ;         // wait 500 ms
                PORTB = 0 ;             // turn all LEDs OFF
                Delay_ms(500) ;         // wait 500 ms
                }
        }
 

.HEX FILE DOWNLOAD TELECHARGEMENT DU FICHIER .HEX
NOTES OBSERVATIONS

Please send comments, suggestions & bug report in my forums.

Merci d'envoyer vos commentaires, suggestions et signalisation de bug dans mon forum.

 

All trademarks and registered trademarks are the property of their respective owners