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

Add to Favourites

PicBasic Sample Code

2k.bas Demo program of table use past 2K
adc71.bas PEEK and POKE Commands - Access 16C71 A/D using Peek and Poke
blink.bas Example program from manual to blink an LED connected to RB0 about once a second
button.bas Demonstrate BUTTON command. Prints working variable (in this case B0) to show how auto-repeat works. Prints "PRESS" when button is pressed or repeated.
ee.bas 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).
flash1.bas Blinks LED using HIGH and LOW commands to control specified pin.
flash2.bas Blinks LED using Direction and Data bit variables.
flash3.bas Blinks LED using Bit Math
flash4.bas Blinks LED using For..Next Loops. Uses Nap for Low Power & Good Measure!!!
for.bas FOR..NEXT Command - Prints series of numbers showing STEP facility. Inner-loop locks up when step size reaches zero (because loop never increments).
high92x.bas Access high register banks in 16C92x
i2c8.bas 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 24LC01, 24LC02, etc.
i2c16.bas 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 24LC32 and 24LC65
lcd.bas Demonstrate operation of an LCD in 4-bit mode
logic.bas Display Truth Table for Binary Logical Operators
lookdown.bas LOOKDOWN Command - Convert ASCII Hexadecimal characters to numeric equivalents.
lookup.bas LOOKUP & RANDOM Commands - Convert numeric value to ASCII Hexadecimal equivalents.
minmax.bas Use MIN and MAX operators to Bound [0..9] to [3..7]
porta.bas Read and write PortA using Peek and Poke
ps2clock.bas PicStic-2 Clock Test - Requires Micromint PicStic-2 with JRC6355
ps3adc.bas PicStic-3 ADC Test - Requires Micromint PicStic-3 with LTC1298
pulsin.bas PULSIN Command - Serial Pulse Width Meter
pulsout.bas PULSOUT Command - Variable Pulse Generator. Two buttons adjust from off to 10mSec in 10 uSec steps.
serin.bas SERIN & SEROUT Commands - Upper case serial filter.
serqual.bas SERIN Command w/ Qualifiers - "Crude" serial filter for C++ Style Comments
shift.bas Simulate BS2 Shiftin and Shiftout
sleep.bas SLEEP Command - Slowly Blink LED Using Low Power Mode Delay
sound.bas SOUND Command - Make random computer-like noises. More refinement might make sound effects realistic enough to convince your boss you're working when you're really just playing Half-Life 2!!!
usart.bas Read and write hardware USART using Peek and Poke. For 16C63, 65(A), 73(A), 74(A).

Page Updated:
18/05/10

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