PicBasic Pro Programs

Link to PicBasic Pro Robotics Programs

Link to PicBasic Pro DS1620 Programs

These fundamental PicBasic Pro programs were written to introduce new statements that periodically would be combined into a program with a robotic application. Most of the programs are very short, focusing on one new command or a new application of a command. Check Technical Lessons for Year 2 for more background information.

The microcontroller used for the most part is the PIC16F88-I/P from Microchip Technology,
http://microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=64. The data sheet is available at: http://ww1.microchip.com/downloads/en/devicedoc/30487c.pdf. Jameco stocks the PIC16F88-I/P at a cost of $4.15 each for quantities less than 25. Microchipdirect lists the PIC16F88-I/P at $2.60 each for quantities less than 26.

The programs are written in PicBasic Pro from micro-Engineering Labs, Inc., melabs.com.
We prefer the melabs U2 Programmer over the EPIC Programmer. Both programmers are displayed at: http://melabs.com/products/bundles.htm. The cost for both the PicBasic Pro Compiler and the U2 Programmer with Accessories is $359.90 USD.

Program Name
Program
Description

New PICBASIC PRO Statements

Code as .pdf
file
Schematic for Code
Download PicBasic Pro Code
as .pbp File
blink1 LED flashes on and off one time per second. PAUSE, GOTO, END PDF file blink1
5 v Voltage
Regulator
blink1.pbp
flicker2 LED flashes on and off one time per half second using different commands. HIGH, LOW PDF file flicker2 flicker2.pbp
railroad Two LED's flash like a railroad crossing.   PDF file railroad railroad.pbp
flicker3 Turns one LED on and off 5 times. FOR..NEXT PDF file flicker3 flicker3.pbp
bounce1 Eight LED's scroll on from the right then to the left then back again.   PDF file bounce1 bounce1.pbp
bounce2 Eight LED's scroll off from the right then to the left.   PDF file bounce2 bounce2.pbp
count1 Eight LEDs count in binary from 1 to 255   PDF file count1 count1.pbp
count2 Display 8-bit
number as
decimal,
hexadecimal,
binary number
  PDF file count2 count2.pbp
switch1 Turn on/off LED's with button switch. IF..THEN PDF file switch1 switch1.pbp
master_ slave1 Master MCU drives slave MCU   PDF file PDF file m_s1 m_s_m1.pbp m_s_s1.pbp
servo1 Rotates servo cwise and ccwise using PULSOUT PULSOUT PDF file servo1 servo1.pbp
servo2 Rotates servo cwise and ccwise using PAUSEUS PAUSEUS PDF file servo2 servo2.pbp
servo3 Rotates servo cwise and ccwise in incremental steps   PDF file servo3 servo3.pbp
servo4 Servo position determined by switch inputs   PDF file servo4 servo4.pbp
switch2 Switch drives LED and servo. IF..THEN.. ELSE PDF file switch2 switch2.pbp
LCD1 Prints simple message to LCD. LCDOUT PDF file lcd1 LCD1.pbp
LCD2 Demonstrates several commands to move LCD cursor.   PDF file lcd2 LCD2.pbp
LCD3 Display resistance readings from a potentiometer. POT PDF file lcd3 LCD3.pbp
h_bridge PIC drives SN754410 1.5 A driver   PDF file h_bridge1 h_bridge_pic1.pbp
pwm1 Drives dc motors at different speeds. Jameco motor1 motor2 PWM PDF file pwm1 pwm1.pbp
hpwm1 Shows HPWM working in program background HPWM PDF file hpwm1 hpwm1.pbp
hpwm2 Changes speeds using HPWM   PDF file hpwm2 hpwm2.pbp
hpwm3 Basic HPWM program   PDF file hpwm3 hpwm3.pbp

pwm_

hpwm1

Runs PWM and HPWM commands together   PDF file pwm_hpwm1 pwm_hpwm1

switch_

limit1

Uses limit switches to reverse motor See Video   PDF file switch_limit1 switch_limit1
adc1 8-Bit Analog-to-Digital conversion ADCIN PDF file adc1 adc1.pbp
adc2 10-bit Analog-to-Digital conversion   PDF file adc1 adc2.pbp
adc3 Converts 10-Bit data to voltage   PDF file adc1 adc3.pbp
bend_sensor1 Use flex sensor to rotate hobby servo See Video   PDF file bend_sensor1 bend_sensor1
sonar1 Displays SRF04 sonar readings to LCD. PULSIN PDF file sonar1 sonar1
sonar2 LED's light up as sonar is brought close to an object.   PDF File sonar2 sonar2
array1 Set up two 6 element arrays   PDF file array1 array1
array2 Find max value in 7 element array   PDF file array2 array2
shift1 Use shift operator << to shift value to left Shift Operator PDF file shift1 shift1.pbp
signed_num1 Display signed numbers   PDF file signed_num1 signed_num1

 


Copyright 2008, Cornerstone Robotics / Disclaimer