ME Labs, Inc.
719-520-5323
 
Home:
  Developer Resources:

Programming Clues
    Sample Programs
   
    PICBASIC PRO™
Compiler Manual
    PICBASIC™ Compiler
Manual
    Serin2/Serout2 Modes
    ASCII Character Set
    Number Conversion
    Floating Point
Routines
    PBP Debug Monitor
    Articles and Tutorials

Hardware Clues
    Parts / Vendor List
    PICPROTO™ Boards
    LAB-X1 Docs
    LAB-X2 Docs
    LAB-X20 Docs
    LAB-X3 Docs
    LAB-X4 Docs
    LAB-XUSB Docs
    LAB-XT Docs
     
 

ME Labs, Inc. | 1-719-520-5323 | Example Program - BLINK.pbp

PICBASIC PRO program to to blink an LED connected to PORTB.0 about once a second
' Name        : BLINK.pbp
' Compiler    : PICBASIC PRO Compiler 2.6
' Assembler   : PM or MPASM
' Target PIC  : 16F or 18F types
' Hardware    : Non specific
' Oscillator  : internal or external
' Keywords    : BLINK LED
' Description : PICBASIC PRO program to to blink an LED connected
' to PORTB.0 about once a second
'

'The following program is a simple test to blink an LED on and off.  Select a
'device in the dropdown list above, then click the Compile Only button on the 
'toolbar to compile the program and generate a hex file.

' Configure pins for digital operation (uncomment as needed).
' These settings are intended as simple examples.  For more detail,
' see the appropriate device datasheet for register descriptions.
'ANSEL =  %00000000  ' 16F88, 16F688, 16F690, 16F88x
'ANSELH = %00000000  ' 16F690, 16F88x
'ADCON1 = %00000111  ' 16F87x, 16F87xA, 18F452
'ADCON1 = %00001111  ' 18F4620 

LED    VAR  PORTB.0   ' Assign name "LED" to PORTB.0

mainloop:
   High LED        ' Turn on LED connected to PORTB.0
   Pause 500       ' Delay for .5 seconds

   Low LED         ' Turn off LED connected to PORTB.0
   Pause 500       ' Delay for .5 seconds

   Goto mainloop   ' Go back to loop and blink LED forever
   
   End

           

Download the program file.