Line 56... |
Line 56... |
56 |
printf(lcd_putc,"%d %d %d %d",bit_test(input_b(),0), bit_test(input_b(),1), bit_test(input_b(),2), bit_test(input_b(),3)); |
56 |
printf(lcd_putc,"%d %d %d %d",bit_test(input_b(),0), bit_test(input_b(),1), bit_test(input_b(),2), bit_test(input_b(),3)); |
57 |
} |
57 |
} |
58 |
} |
58 |
} |
59 |
void send_measuring() |
59 |
void send_measuring() |
60 |
{ |
60 |
{ |
61 |
printf(usb_cdc_putc, "\n\r %5ld %5ld %5ld %5ld %5ld", run, section[0]*0.000010667, section[1]*0.000010667, section[2]*0.000010667, section[3]*0.000010667); |
61 |
printf(usb_cdc_putc, "\n\r %5u %5u %5u %5u %5u", run, section[0], section[1], section[2], section[3]); |
62 |
} |
- |
|
63 |
|
- |
|
64 |
void exeption_inorder() |
62 |
} //*0.000010667 |
65 |
{ |
- |
|
66 |
} |
- |
|
67 |
|
63 |
|
68 |
void main() |
64 |
void main() |
69 |
{ |
65 |
{ |
70 |
unsigned int8 last, input; |
66 |
unsigned int8 last, input; |
71 |
unsigned int16 timer; |
67 |
unsigned int16 timer; |
Line 82... |
Line 78... |
82 |
setup_timer_2(T2_DISABLED,0,1); |
78 |
setup_timer_2(T2_DISABLED,0,1); |
83 |
setup_timer_3(T3_DISABLED|T3_DIV_BY_1); |
79 |
setup_timer_3(T3_DISABLED|T3_DIV_BY_1); |
84 |
setup_comparator(NC_NC_NC_NC); |
80 |
setup_comparator(NC_NC_NC_NC); |
85 |
setup_vref(FALSE); |
81 |
setup_vref(FALSE); |
86 |
enable_interrupts(INT_TIMER0); |
82 |
enable_interrupts(INT_TIMER0); |
- |
|
83 |
enable_interrupts(GLOBAL); |
87 |
|
84 |
|
88 |
lcd_init(); |
85 |
lcd_init(); |
89 |
usb_init(); |
86 |
usb_init(); |
90 |
|
87 |
|
91 |
lcd_gotoxy(1,1); |
88 |
lcd_gotoxy(1,1); |
Line 117... |
Line 114... |
117 |
|
114 |
|
118 |
while(input(BUTTON1)); |
115 |
while(input(BUTTON1)); |
119 |
printf(lcd_putc,"\f\n STOP"); |
116 |
printf(lcd_putc,"\f\n STOP"); |
120 |
time = 0; |
117 |
time = 0; |
121 |
set_timer0(0); |
118 |
set_timer0(0); |
122 |
enable_interrupts(GLOBAL); |
- |
|
123 |
position = 0; |
119 |
position = 0; |
124 |
exception = 0; |
120 |
exception = 0; |
125 |
|
121 |
|
126 |
while((position < 4) && (input(BUTTON2))) // cekame na tlacitko stop nebo na preruseni vsech paprsku |
122 |
while((position < 4) && (input(BUTTON2))) // cekame na tlacitko stop nebo na preruseni vsech paprsku |
127 |
{ |
123 |
{ |
Line 134... |
Line 130... |
134 |
set_timer0(0); |
130 |
set_timer0(0); |
135 |
position++; |
131 |
position++; |
136 |
} |
132 |
} |
137 |
last=input_b(); |
133 |
last=input_b(); |
138 |
} |
134 |
} |
139 |
if (exception == INORDER) exeption_inorder(); |
135 |
if (exception == INORDER) |
- |
|
136 |
{ |
- |
|
137 |
printf(lcd_putc,"\fInorder! Send?"); |
- |
|
138 |
lcd_gotoxy(1,2); |
- |
|
139 |
printf(lcd_putc,"YES NO"); |
- |
|
140 |
While(input(BUTTON1) && input(BUTTON4)); |
- |
|
141 |
if(!input(BUTTON1)) send_measuring(); |
- |
|
142 |
if(!input(BUTTON4)) continue; |
- |
|
143 |
} |
140 |
else send_measuring(); |
144 |
else send_measuring(); |
141 |
} |
145 |
} |
142 |
} |
146 |
} |