|
ME Labs, Inc. 719-520-5323 |
|
|
|
ME Labs, Inc. | 1-719-520-5323 | Example Program - PULSOUT.pbpPICBASIC PRO program to demonstrate use of PULSOUT command for a variable pulse generator. Two buttons adjust from off to 10mSec in 10 uSec steps.' Name : PULSOUT.pbp
' Compiler : PICBASIC PRO Compiler 2.6
' Assembler : PM or MPASM
' Target PIC : 12F, 16F, 18F
' Hardware : 2 x normally-open push button switches
' Oscillator : 4MHz internal or external
' Keywords : PULSOUT
' Description : PICBASIC PRO program to demonstrate use of PULSOUT command
' for a variable pulse generator. Two buttons adjust from off to 10mSec in
' 10 uSec steps.
'
Include "bs1defs.bas" ' Include BS1 variables and serial modes
DN Con 5 ' Define frequency down button
UP Con 4 ' Define frequency up button
PO Con 3 ' Define pulse output pin
W0 = 0
Low PO ' Initialize output polarity
inc:
If (Pin4 = 1) Or (W0 = 1000) Then decr ' Increment freq on button
W0 = W0 + 1
decr:
If (Pin5 = 1) Or (W0 = 0) Then pulse ' Decrement freq on button
W0 = W0 - 1
pulse:
Pulsout 3,W0 ' Generate pulse
Pause 10 ' Intra-pulse delay
Goto inc ' Forever
End
Download the program file. |
|
Copyright 2019 ME Labs, Inc. PO Box 8250 Asheville NC 28814 (719) 520-5323 (719) 520-1867 fax email: support@melabs.com |
|