1 |
/***** LX200obfuscator *****/ |
1 |
/***** LX200obfuscator *****/ |
2 |
/***** 2014 (c) MLAB *****/ |
2 |
/***** 2014 (c) MLAB *****/ |
3 |
|
3 |
|
4 |
#include "main.h" |
4 |
#include "main.h" |
5 |
|
5 |
|
6 |
|
6 |
|
7 |
#define LX200 PIN_E0 // Connection to the LX200 |
7 |
#define LX200 PIN_E0 // Connection to the LX200 |
8 |
|
8 |
|
9 |
void main() |
9 |
void main() |
10 |
{ |
10 |
{ |
- |
|
11 |
setup_oscillator(OSC_8MHZ|OSC_INTRC); |
11 |
|
12 |
|
12 |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
13 |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
13 |
setup_adc(ADC_CLOCK_DIV_2); |
14 |
setup_adc(ADC_CLOCK_DIV_2); |
14 |
setup_psp(PSP_DISABLED); |
15 |
setup_psp(PSP_DISABLED); |
15 |
setup_spi(SPI_SS_DISABLED); |
16 |
setup_spi(SPI_SS_DISABLED); |
16 |
setup_wdt(WDT_OFF); |
17 |
setup_wdt(WDT_OFF); |
17 |
setup_timer_0(RTCC_INTERNAL); |
18 |
setup_timer_0(RTCC_INTERNAL); |
18 |
setup_timer_1(T1_DISABLED); |
19 |
setup_timer_1(T1_DISABLED); |
19 |
setup_timer_2(T2_DISABLED,0,1); |
20 |
setup_timer_2(T2_DISABLED,0,1); |
20 |
setup_timer_3(T3_DISABLED|T3_DIV_BY_1); |
21 |
setup_timer_3(T3_DISABLED|T3_DIV_BY_1); |
21 |
setup_comparator(NC_NC_NC_NC); |
22 |
setup_comparator(NC_NC_NC_NC); |
22 |
setup_vref(FALSE); |
23 |
setup_vref(FALSE); |
23 |
|
24 |
|
24 |
while(TRUE) |
25 |
while(TRUE) |
25 |
{ |
26 |
{ |
26 |
output_low(LX200); |
27 |
output_low(LX200); |
27 |
delay_ms(1000); |
28 |
delay_ms(1000); |
28 |
output_high(LX200); |
29 |
output_high(LX200); |
29 |
delay_us(100); |
30 |
delay_us(100); |
30 |
output_toggle(LX200); |
31 |
output_toggle(LX200); |
31 |
delay_us(940); |
32 |
delay_us(940); |
32 |
output_toggle(LX200); |
33 |
output_toggle(LX200); |
33 |
delay_us(100); |
34 |
delay_us(100); |
34 |
output_toggle(LX200); |
35 |
output_toggle(LX200); |
35 |
delay_us(940); |
36 |
delay_us(940); |
36 |
output_toggle(LX200); |
37 |
output_toggle(LX200); |
37 |
delay_us(100); |
38 |
delay_us(100); |
38 |
output_toggle(LX200); |
39 |
output_toggle(LX200); |
39 |
delay_us(940); |
40 |
delay_us(940); |
40 |
output_toggle(LX200); |
41 |
output_toggle(LX200); |
41 |
delay_us(200); |
42 |
delay_us(200); |
42 |
output_toggle(LX200); |
43 |
output_toggle(LX200); |
43 |
delay_us(100); |
44 |
delay_us(100); |
44 |
output_toggle(LX200); |
45 |
output_toggle(LX200); |
45 |
delay_us(100); |
46 |
delay_us(100); |
46 |
output_toggle(LX200); |
47 |
output_toggle(LX200); |
47 |
delay_us(100); |
48 |
delay_us(100); |
48 |
output_toggle(LX200); |
49 |
output_toggle(LX200); |
49 |
delay_us(100); |
50 |
delay_us(100); |
50 |
output_toggle(LX200); |
51 |
output_toggle(LX200); |
51 |
delay_us(100); |
52 |
delay_us(100); |
52 |
output_toggle(LX200); |
53 |
output_toggle(LX200); |
53 |
delay_us(200); |
54 |
delay_us(200); |
54 |
output_toggle(LX200); |
55 |
output_toggle(LX200); |
55 |
} |
56 |
} |
56 |
} |
57 |
} |