View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Mar 12, 2006 1:26 am |
|
|
One way to simplify it is to just cut out the options and the RS-232 stuff:
Code: |
#include <16F877.h>
#device adc=8
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=10000000)
void main()
{
int8 value;
setup_ccp1(CCP_PWM);
setup_timer_2(T2_DIV_BY_4, 127, 1);
setup_port_a(ALL_ANALOG);
setup_adc(ADC_CLOCK_INTERNAL);
set_adc_channel(0);
while(1)
{
value = read_adc();
set_pwm1_duty(value);
}
} |
|
|
|
hongtao
Joined: 09 Mar 2006 Posts: 4 Location: Shanghai China
|
|
Posted: Wed Mar 15, 2006 5:26 am |
|
|
Hi
PCM programmer, thanks. It works. I can use it in my program.I find so
many post about PWM, after finishing my graduation project, I will write a
post to make a summary or a index, may be it will be easy to check.
谢谢!! |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|