Sunday, March 05, 2006

w_4_simple PWM_code from Michael

'****************************************************************
'* 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.0

arf var byte
duty var byte
counter var byte

for arf = 0 to 3
high portc.0
pause 100
low portc.0
pause 200
next

main:

for duty = 0 to 255
pwm portc.0, duty, 1
next

goto main

0 Comments:

Post a Comment

<< Home