| Line 32... |
Line 32... |
| 32 |
} |
32 |
} |
| 33 |
} |
33 |
} |
| 34 |
|
34 |
|
| 35 |
void main() |
35 |
void main() |
| 36 |
{ |
36 |
{ |
| 37 |
unsigned int16 setpoint; |
37 |
unsigned int16 setpoint=43; |
| 38 |
unsigned int16 napeti; |
38 |
unsigned int16 napeti; |
| 39 |
unsigned int16 plneni=0; |
39 |
unsigned int16 plneni=0; |
| 40 |
unsigned int1 button_press; // semafor pro cteni tlacitek |
40 |
unsigned int1 button_press; // semafor pro cteni tlacitek |
| 41 |
|
41 |
|
| 42 |
lcd_init(); |
- |
|
| 43 |
|
- |
|
| 44 |
lcd_putc("\fHVPS01A 2013 MLAB\n"); |
- |
|
| 45 |
Delay_ms(1000); |
- |
|
| 46 |
|
- |
|
| 47 |
setup_adc_ports(sAN0|VSS_VDD); |
42 |
setup_adc_ports(sAN0|VSS_VDD); |
| 48 |
setup_adc(ADC_CLOCK_DIV_32); |
43 |
setup_adc(ADC_CLOCK_DIV_32); |
| 49 |
setup_spi(SPI_SS_DISABLED); |
44 |
setup_spi(SPI_SS_DISABLED); |
| 50 |
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
45 |
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
| 51 |
setup_timer_1(T1_DISABLED); |
46 |
setup_timer_1(T1_DISABLED); |
| Line 56... |
Line 51... |
| 56 |
setup_oscillator(OSC_8MHZ); |
51 |
setup_oscillator(OSC_8MHZ); |
| 57 |
|
52 |
|
| 58 |
set_pwm1_duty(0); |
53 |
set_pwm1_duty(0); |
| 59 |
set_pwm2_duty(0); |
54 |
set_pwm2_duty(0); |
| 60 |
|
55 |
|
| 61 |
|
- |
|
| 62 |
output_high(LED1); |
56 |
output_high(LED1); |
| 63 |
output_high(LED2); |
57 |
output_high(LED2); |
| 64 |
output_high(LED3); |
58 |
output_high(LED3); |
| 65 |
output_high(LED4); |
59 |
output_high(LED4); |
| - |
|
60 |
output_low(BEEP); |
| - |
|
61 |
|
| - |
|
62 |
lcd_init(); |
| 66 |
|
63 |
|
| 67 |
// ext_int_edge( L_TO_H ); // Sets up EXT |
64 |
lcd_putc("\fHVPS01A 2013 MLAB\n"); |
| 68 |
// enable_interrupts(INT_EXT); |
- |
|
| 69 |
// enable_interrupts(GLOBAL); |
65 |
Delay_ms(1000); |
| 70 |
|
66 |
|
| 71 |
setpoint = 43; |
- |
|
| 72 |
lcd_putc("\f"); |
67 |
lcd_putc("\f"); |
| 73 |
|
68 |
|
| 74 |
while(true) |
69 |
while(true) |
| 75 |
{ |
70 |
{ |
| 76 |
|
71 |
|