Line 50... |
Line 50... |
50 |
unsigned int16 setpoint=43; |
50 |
unsigned int16 setpoint=43; |
51 |
unsigned int16 napeti; |
51 |
unsigned int16 napeti; |
52 |
unsigned int1 button_press; // semafor pro cteni tlacitek |
52 |
unsigned int1 button_press; // semafor pro cteni tlacitek |
53 |
|
53 |
|
54 |
setup_adc_ports(sAN0|VSS_VREF); |
54 |
setup_adc_ports(sAN0|VSS_VREF); |
55 |
setup_adc(ADC_CLOCK_DIV_2); |
55 |
setup_adc(ADC_CLOCK_DIV_32); |
56 |
setup_spi(SPI_SS_DISABLED); |
56 |
setup_spi(SPI_SS_DISABLED); |
57 |
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
57 |
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
58 |
setup_timer_1(T1_DISABLED); |
58 |
setup_timer_1(T1_DISABLED); |
59 |
setup_timer_2(T2_DIV_BY_1,DIVISOR,1); |
59 |
setup_timer_2(T2_DIV_BY_1,DIVISOR,1); |
60 |
setup_ccp1(CCP_PWM); |
60 |
setup_ccp1(CCP_PWM); |
Line 62... |
Line 62... |
62 |
set_pwm1_duty(HALFDUTY); |
62 |
set_pwm1_duty(HALFDUTY); |
63 |
set_pwm2_duty(MAXDUTY); |
63 |
set_pwm2_duty(MAXDUTY); |
64 |
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
64 |
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
65 |
setup_oscillator(OSC_8MHZ); |
65 |
setup_oscillator(OSC_8MHZ); |
66 |
|
66 |
|
- |
|
67 |
// enable_interrupts(GLOBAL); |
- |
|
68 |
|
67 |
output_high(LED1); |
69 |
output_high(LED1); |
68 |
output_high(LED2); |
70 |
output_high(LED2); |
69 |
output_high(LED3); |
71 |
output_high(LED3); |
70 |
output_high(LED4); |
72 |
output_high(LED4); |
71 |
output_low(BEEP); |
73 |
output_low(BEEP); |
Line 79... |
Line 81... |
79 |
lcd_putc(" MLAB.cz"); |
81 |
lcd_putc(" MLAB.cz"); |
80 |
Delay_ms(1000); |
82 |
Delay_ms(1000); |
81 |
|
83 |
|
82 |
lcd_putc("\f"); |
84 |
lcd_putc("\f"); |
83 |
|
85 |
|
- |
|
86 |
//read_adc(ADC_START_ONLY); |
84 |
|
87 |
|
85 |
while(true) |
88 |
while(true) |
86 |
{ |
89 |
{ |
87 |
napeti = read_adc(); |
90 |
napeti = read_adc(); |
88 |
if(input(OUTPUT_ENABLE)) |
91 |
if(input(OUTPUT_ENABLE)) |