english français deutsch
italiano portugese español

PicBasic Compiler Code Samples

A collection of sample programs for use with the PicBasic Compiler from MicroEngineering Labs.

PicBasic Compiler Code Sample - 2k.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate table use past 2K.

source code

PicBasic Compiler Code Sample - adc71.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate PEEK and POKE commands. Access 16C71 A/D using PEEK and POKE.

source code

PicBasic Compiler Code Sample - blink.pbc

Picbasic Compiler Product Thumb

PicBasic program to blink an LED connected to RB0 about once a second.

source code

PicBasic Compiler Code Sample - button.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate the BUTTON command. Prints working variable (in this case B0) to show how auto-repeat works. Prints "PRESS" when button is pressed or repeated.

source code

PicBasic Compiler Code Sample - ee.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate commands for EEPROM. Works on 16C84 and 16Fxxx targets only! Initialized address 0..5 and 9. Writes 10..63. This leaves addresses 6..8 undefined (assuming your programmer doesn;t unconditionally program all EEPROM locations).

source code

PicBasic Compiler Code Sample - flash1.pbc

Picbasic Compiler Product Thumb

PicBasic program to blink LED using HIGH and LOW commands to control specified pin.

source code

PicBasic Compiler Code Sample - flash2.pbc

Picbasic Compiler Product Thumb

PicBasic program to blink LED using DIRECTION and DATA bit variables.

source code

PicBasic Compiler Code Sample - flash3.pbc

Picbasic Compiler Product Thumb

PicBasic program to blink LED using bit mathematics.

source code

PicBasic Compiler Code Sample - flash4.pbc

Picbasic Compiler Product Thumb

PicBasic program to blink LED using FOR..NEXT loops. Uses NAP for low lower.

source code

PicBasic Compiler Code Sample - for.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate FOR..NEXT command. Prints series of numbers showing STEP facility. Inner-loop locks up when step size reaches zero (because loop never increments).

source code

PicBasic Compiler Code Sample - high92x.pbc

Picbasic Compiler Product Thumb

PicBasic program to access high register banks in 16C92x.

source code

PicBasic Compiler Code Sample - i2c16.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate I2CIN and I2COUT commands. Write address to the first 16 locations of an external serial EEPROM. Read first 16 locations back and send to serial out repeatedly. The control byte and address variable are selected for EEPROM's with 2-byte addressing, such as the 24LC32 and 24LC65.

source code

PicBasic Compiler Code Sample - i2c8.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate I2CIN and I2COUT commands. Write address to the first 16 locations of an external serial EEPROM. Read first 16 locations back and send to serial out repeatedly. The control byte and address variable are selected for EEPROM's with 1-byte addressing, such as the 24LC01, 24LC02, etc.

source code

PicBasic Compiler Code Sample - lcd.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate the operation of an LCD in 4-bit mode.

source code

PicBasic Compiler Code Sample - logic.pbc

Picbasic Compiler Product Thumb

PicBasic program to display truth table for Binary Logical Operators.

source code

PicBasic Compiler Code Sample - lookdown.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate LOOKDOWN command. Convert ASCII hexadecimal characters to numeric equivalents.

source code

PicBasic Compiler Code Sample - lookup.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate LOOKUP and RANDOM commands. Convert numeric value to ASCII hexadecimal equivalents.

source code

PicBasic Compiler Code Sample - minmax.pbc

Picbasic Compiler Product Thumb

PicBasic program to use MIN and MAX operators to bound [0..9] to [3..7].

source code

PicBasic Compiler Code Sample - porta.pbc

Picbasic Compiler Product Thumb

PicBasic program to read and write PORTA using PEEK and POKE.

source code

PicBasic Compiler Code Sample - ps2clock.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate PicStic-2 Clock Test. Requires Micromint PicStic-2 with JRC6355.

source code

PicBasic Compiler Code Sample - ps3adc.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate PicStic-3 ADC Test. Requires Micromint PicStic-3 with LTC1298.

source code

PicBasic Compiler Code Sample - pulsin.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate PULSIN command. Serial Pulse Width Meter.

source code

PicBasic Compiler Code Sample - pulsout.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate PULSOUT command. Variable Pulse Generator. Two buttons adjust from off to 10ms in 10 us steps.

source code

PicBasic Compiler Code Sample - serin.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate SERIN and SEROUT commands. Upper case serial filter.

source code

PicBasic Compiler Code Sample - serqual.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate SERIN command with qualifiers. "Crude" serial filter for C++ style comments.

source code

PicBasic Compiler Code Sample - shift.pbc

Picbasic Compiler Product Thumb

PicBasic program to simulate BS2 SHIFTIN and SHIFTOUT.

source code

PicBasic Compiler Code Sample - sleep.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate SLEEP command. Slowly blink LED using low power mode delay.

source code

PicBasic Compiler Code Sample - sound.pbc

Picbasic Compiler Product Thumb

PicBasic program to demonstrate SOUND command. Make random computer-like noises.

source code

PicBasic Compiler Code Sample - usart.pbc

Picbasic Compiler Product Thumb

PicBasic program to read and write hardware USART using PEEK and POKE. For 16C63, 16C65(A), 16C73(A) and 16C74(A).

source code

Page Updated:
20/12/11

Visa Credit
Mastercard
Visa Debit
Maestro
Visa Electron
Paypal

Tel: +44 7814 044 754 - Fax: +44 8715 283 948 - Skype: warburtech.co.uk

Warburton Technology, 33 Selkirk Close, Wimborne, Dorset, BH21 1TN, United Kingdom

VAT Number: GB 846 917 877