'**************************************************************** '* Name : UNTITLED.BAS * '* Author : [select VIEW...EDITOR OPTIONS] * '* Notice : Copyright (c) 2005 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 9/29/2005 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** DEFINE OSC 4 output portc.3 start: pulseWidth var byte ' set up constants with the minimum and maximum pulsewidths minPulse CON 50 maxPulse CON 250 ' set up a constant with the time between pulses: refreshPeriod CON 20 ' set an initial pulsewidth: pulseWidth = minPulse main: 'take the output pin low so we can pulse it high Low PORTC.3 ' pulse the pin PulsOut PORTC.3, pulseWidth ' pause for as long as needed: Pause refreshPeriod ' change the angle for the next time around: IF pulseWidth > maxPulse Then pulseWidth = minPulse Else pulseWidth = pulseWidth + 1 'try changing this number what happen Endif GoTo main