#include <16f877A.H>
#fuses NOPROTECT, NOWDT, NOLVP,xt
#device adc=8
#use delay(clock=4000000)
#use rs232(baud=2400, xmit=PIN_c6, rcv=PIN_c7)
#use fast_io(a)
#use fast_io(b)
//unsigned int j;
char j;
void main(){
setup_timer_1(t1_disabled);
setup_timer_2(t2_disabled,0,1);
setup_ccp1(ccp_off);
set_tris_a(0xff); // A PORTU GİRİŞ
set_tris_b(0x00); // B PORTU ÇIKIŞ
setup_adc(adc_clock_internal);
setup_adc_ports(all_analog);
while(1)
{
set_adc_channel(0);
delay_ms(10);
j=read_adc();
putc(j);
}
}
#include <16f877A.H>
#fuses NOPROTECT, NOWDT, NOLVP,xt
#use delay(clock=4000000)
#use rs232(baud=2400, xmit=PIN_c6, rcv=PIN_c7)
#use fast_io(a)
#use fast_io(b)
char j;
unsigned int i,k;
void main()
{
set_tris_b(0x00);
output_b(0xff);
setup_ccp1(ccp_pwm);
setup_timer_2(t2_div_by_16,256,1);
set_pwm1_duty(1);
while(1)
{
j=getc();
set_pwm1_duty(j);
}
}