-
Notifications
You must be signed in to change notification settings - Fork 1
/
new 2.txt
executable file
·789 lines (699 loc) · 18.9 KB
/
new 2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
-- ---------------------------------------------------------------
-- Title:GLCD SWR Meter
--
-- Author: Robert de Kok, Copyright (c) 2014, all rights reserved.
-- ----------------------------------------------------------------
include 18f4550
include SWRHelpers
pragma target clock 8_000_000 -- 20_000_000
pragma target OSC INTOSC_PORTIO --hs
OSCCON_IRCF = 0b_111
UCON_USBEN = 0 ;disable USB
UCFG_UTRDIS = 1 ;disable USB
UCFG = 0b_00001000
pragma target WDT disabled
pragma target LVP disabled
enable_digital_io() -- all pins digital I/O
include delay
include print
include glcd_5x7_font -- font to be used
include glcd_8x12_font -- font to be used
include glcd_6x8_font -- font to be used
include glcd_font -- common font stuff
include glcd_ks0108 -- glcd device dependent library
include glcd_common -- device independent glcd library
glcd_font_use(FONT_6X8) -- activate font
glcd_init() -- initialize display
procedure DrawDemo() is
glcd_pen_color = GLCD_BLACK -- pixel color
glcd_clear_screen()
for 2 loop
for ((GLCD_X_PIXELS / 2) - 1) using i loop -- line animation
glcd_line(i * 2, 0, GLCD_X_PIXELS - i * 2 - 1, GLCD_Y_PIXELS - 1)
delay_1ms(3)
end loop
for (GLCD_Y_PIXELS - 1) using i loop
glcd_line(GLCD_X_PIXELS - 1, i, 0, GLCD_Y_PIXELS - i)
delay_1ms(3)
end loop
glcd_pen_color = GLCD_WHITE -- 'erase' first pattern
end loop
delay_100ms(2)
glcd_pen_color = GLCD_BLACK -- pixel color
glcd_clear_screen()
end procedure
DrawDemo()
glcd_char_goto(0,10)
print_string(glcd, msg1)
glcd_char_goto(0,20)
print_string(glcd, msg2)
glcd_char_goto(2,35)
print_string(glcd, msg3)
glcd_char_goto(2,50)
print_string(glcd, msg4)
delay_100ms(20)
glcd_clear_screen()
const bit ADC_HIGH_RESOLUTION = high
const byte ADC_NCHANNEL = 1
const byte ADC_NVREF = ADC_NO_EXT_VREF
include adc
adc_init()
readEeprom()
procedure WriteSWR(bit in isTwee) is
if isTwee==0 then
RecalcSwr(w1measure,w2measure)
else
RecalcSwr(w4measure,w5measure)
end if
if swr==255 then
print_string(glcd,maxswr)
else
print_string(glcd,sw2str)
--print_word_dec(glcd, swr)
print_word_dec(glcd, swrh)
print_string(glcd,pntstr)
print_word_dec(glcd, swrl)
end if
end procedure
procedure WriteMtrType(bit in isMeterTwee) is
if isMeterTwee==0 then
if (mtype1==headIsHF) then
print_string(glcd,isHF)
end if
if (mtype1==headIs4M) then
print_string(glcd,is4M)
end if
if (mtype1==headIsVHF) then
print_string(glcd,isVHF)
end if
if (mtype1==headIsUHF) then
print_string(glcd,isUHF)
end if
if (mtype1==headIsSHF) then
print_string(glcd,isSHF)
end if
if (mtype1==headIsNC) then
print_string(glcd,isNC)
end if
else
if (mtype2==headIsHF) then
print_string(glcd,isHF)
end if
if (mtype2==headIs4M) then
print_string(glcd,is4M)
end if
if (mtype2==headIsVHF) then
print_string(glcd,isVHF)
end if
if (mtype2==headIsUHF) then
print_string(glcd,isUHF)
end if
if (mtype2==headIsSHF) then
print_string(glcd,isSHF)
end if
if (mtype2==headIsNC) then
print_string(glcd,isNC)
end if
end if
end procedure
procedure DrawMeter(byte in b) is
glcd_pen_color = GLCD_BLACK
glcd_box(0+b,0,63+b,63)
glcd_box(0+b,52,63+b,63)
glcd_box(0+b,49,3+b,52)
glcd_box(60+b,49,63+b,52)
glcd_pen_color = GLCD_WHITE
glcd_box(1+b,53,62+b,62)
glcd_pen_color = GLCD_BLACK
glcd_char_goto(2+b,54)
;print_string(glcd,forwart)
if b==0 then
WriteMtrType(0)
else
WriteMtrType(1)
end if
glcd_char_goto(43+b,54)
print_string(glcd,reverse)
glcd_circle(31+b,57, 3)
glcd_line(30+b,55,32+b,59)
glcd_char_goto(2+b, 2)
if b==0 then
print_string(glcd,swr1)
WriteSWR(0)
else
print_string(glcd,swr2)
WriteSWR(1)
end if
end procedure
procedure PrintWattSign(bit in isTwee, byte in i) is
if isTwee==0 then
if (auto1_vo == 1) & (i>0) then
print_string(glcd,watXstr)
else
print_string(glcd,watstr)
end if
else
if (auto2_vo == 1) & (i>0) then
print_string(glcd,watXstr)
else
print_string(glcd,watstr)
end if
end if
end procedure
procedure WriteValues(byte in b, bit in isMeterTwee) is
glcd_char_goto(2+b, 5)
WriteMtrType(isMeterTwee)
if isMeterTwee==0 then
print_string(glcd,swr1)
else
print_string(glcd,swr2)
end if
if isMeterTwee==0 then
i = PWRLOOKUP[w1measure/10]
else
i = PWRLOOKUP[w4measure/10]
end if
print_word_dec(glcd, i)
PrintWattSign(isMeterTwee,i)
if i<10 then
print_string(glcd,empstr)
end if
glcd_char_goto(2+b, 20)
print_string(glcd,refstr)
if isMeterTwee==0 then
i = PWRLOOKUP[w2measure/10]
else
i = PWRLOOKUP[w5measure/10]
end if
print_word_dec(glcd, i)
PrintWattSign(isMeterTwee,i)
if i<10 then
print_string(glcd,empstr)
end if
glcd_char_goto(2+b, 35)
print_string(glcd,peakst)
if isMeterTwee==0 then
i = PWRLOOKUP[w3measure/10]
else
i = PWRLOOKUP[w6measure/10]
end if
print_word_dec(glcd, i)
PrintWattSign(isMeterTwee,i)
if i<10 then
print_string(glcd,empstr)
end if
glcd_char_goto(2+b, 50)
if (isReverse == 1) then
print_string(glcd,swrxstr)
else
print_string(glcd,swrstr)
end if
WriteSWR(isMeterTwee)
end procedure
procedure writeSubMenu(byte in menuAmpl, byte in menuVolt, byte in headType[], byte in mprValue, byte in mpvValue) is
glcd_char_goto(2, 25)
print_string(glcd,empstr)
print_string(glcd,headType)
glcd_char_goto(2, 35)
if menuNo==menuAmpl then
print_string(glcd,starstr)
else
print_string(glcd,empstr)
end if
print_string(glcd,mpr)
print_word_dec(glcd, mprValue)
if mprValue<10 then
print_string(glcd,empstr)
end if
glcd_char_goto(2, 45)
if menuNo==menuVolt then
print_string(glcd,starstr)
else
print_string(glcd,empstr)
end if
print_string(glcd,volt)
if mpvValue==1 then
print_string(glcd,voltOn)
else
print_string(glcd,voltOff)
end if
end procedure
procedure WriteMenu() is
glcd_char_goto(2, 0)
if mtype1==headIsHF then
print_string(glcd,isHF)
end if
if mtype1==headIs4M then
print_string(glcd,is4M)
end if
if mtype1==headIsVHF then
print_string(glcd,isVHF)
end if
if mtype1==headIsUHF then
print_string(glcd,isUHF)
end if
if mtype1==headIsSHF then
print_string(glcd,isSHF)
end if
if mtype1==headIsNC then
print_string(glcd,isNC)
end if
print_string(glcd,empstr)
print_string(glcd,power1)
i = PWRLOOKUP[w1measure/10]
print_word_dec(glcd, i)
print_string(glcd,watstr)
if i<10 then
print_string(glcd,empstr)
end if
glcd_char_goto(2, 10)
if mtype2==headIsHF then
print_string(glcd,isHF)
end if
if mtype2==headIs4M then
print_string(glcd,is4M)
end if
if mtype2==headIsVHF then
print_string(glcd,isVHF)
end if
if mtype2==headIsUHF then
print_string(glcd,isUHF)
end if
if mtype2==headIsSHF then
print_string(glcd,isSHF)
end if
if mtype2==headIsNC then
print_string(glcd,isNC)
end if
print_string(glcd,empstr)
print_string(glcd,power2)
i = PWRLOOKUP[w4measure/10]
print_word_dec(glcd, i)
print_string(glcd,watstr)
if i<10 then
print_string(glcd,empstr)
end if
if (menuNo == menuHFAmpl)|(menuNo == menuHFVolt) then
writeSubMenu(menuHFAmpl,menuHFVolt,isHF,mpr_hf,mpv_hf)
end if
if (menuNo==menu4MAmpl)|(menuNo==menu4MVolt) then
writeSubMenu(menu4MAmpl,menu4MVolt,is4M,mpr_4m,mpv_4m)
end if
if (menuNo==menuVHFAmpl)|(menuNo==menuVHFVolt) then
writeSubMenu(menuVHFAmpl,menuVHFVolt,isVHF,mpr_vhf,mpv_vhf)
end if
if (menuNo==menuUHFAmpl)|(menuNo==menuUHFVolt) then
writeSubMenu(menuUHFAmpl,menuUHFVolt,isUHF,mpr_uhf,mpv_uhf)
end if
if (menuNo==menuSHFAmpl)|(menuNo==menuSHFVolt) then
writeSubMenu(menuSHFAmpl,menuSHFVolt,isSHF,mpr_shf,mpv_shf)
end if
end procedure
procedure MyInt is pragma interrupt
if INTCON_INT0IF then
INTCON_INT0IF = off
end if
if INTCON3_INT1IF then
menuPressed1 = 0
menuPressed2 = 0
if (rotaryFunction == RotaryNull) then
rotaryFunction = RotaryPressed
end if
while (pin_b1 == 0) Loop -- & (menuPressed2<2)
menuPressed1 = menuPressed1 + 1
if (menuPressed1 == 50000) then
menuPressed1 = 0
menuPressed2 = menuPressed2 + 1
end if
end loop
INTCON3_INT1IF = off
end if
if INTCON3_INT2IF then
if (rotaryFunction == RotaryNull) then
if (rotary_dir == 0) then
rotaryFunction = RotaryLeft
else
rotaryFunction = RotaryRight
end if
end if
INTCON3_INT2IF = off
end if
end procedure
procedure MeasureADC() is
if (isReverse == 1) then
w1measure = adc_read(1)
w2measure = adc_read(0)
w4measure = adc_read(3)
w5measure = adc_read(2)
else
w1measure = adc_read(0)
w2measure = adc_read(1)
w4measure = adc_read(2)
w5measure = adc_read(3)
end if
end procedure
procedure HandleMenu() is
if (rotaryFunction == RotaryPressed) then
if mtrMode != DispMenu then
mtrMode = DispMenu
else
menuNo = menuNo + 1
if (menuNo == MenuMax) then
writeEeprom()
mtrMode = DispAnalog1Analog2
menuNo = 1
end if
end if
glcd_clear_screen()
end if
if (rotaryFunction == RotaryLeft) then
if (mtrMode == DispMenu) then
if menuNo== menuHFAmpl then
mpr_hf = mpr_hf + 1
end if
if menuNo== menuHFVolt then
mpv_hf = mpv_hf + 1
end if
if menuNo== menu4MAmpl then
mpr_4m = mpr_4m + 1
end if
if menuNo== menu4MVolt then
mpv_4m = mpv_4m + 1
end if
if menuNo== menuVHFAmpl then
mpr_vhf = mpr_vhf + 1
end if
if menuNo== menuVHFVolt then
mpv_vhf = mpv_vhf + 1
end if
if menuNo== menuUHFAmpl then
mpr_uhf = mpr_uhf + 1
end if
if menuNo== menuUHFVolt then
mpv_uhf = mpv_uhf + 1
end if
if menuNo== menuSHFAmpl then
mpr_shf = mpr_shf + 1
end if
if menuNo== menuSHFVolt then
mpv_shf = mpv_shf + 1
end if
else
mtrMode = mtrMode + 1
if mtrMode == DispMenu then
mtrMode = DispAnalog1Analog2
end if
end if
glcd_clear_screen()
end if
if (rotaryFunction == RotaryRight) then
if (mtrMode == DispMenu) then
if menuNo== menuHFAmpl then
mpr_hf = mpr_hf - 1
end if
if menuNo== menuHFVolt then
mpv_hf = mpv_hf - 1
end if
if menuNo== menu4MAmpl then
mpr_4m = mpr_4m - 1
end if
if menuNo== menu4MVolt then
mpv_4m = mpv_4m - 1
end if
if menuNo== menuVHFAmpl then
mpr_vhf = mpr_vhf - 1
end if
if menuNo== menuVHFVolt then
mpv_vhf = mpv_vhf - 1
end if
if menuNo== menuUHFAmpl then
mpr_uhf = mpr_uhf - 1
end if
if menuNo== menuUHFVolt then
mpv_uhf = mpv_uhf - 1
end if
if menuNo== menuSHFAmpl then
mpr_shf = mpr_shf - 1
end if
if menuNo== menuSHFVolt then
mpv_shf = mpv_shf - 1
end if
else
mtrMode = mtrMode - 1
if mtrMode == DispNull then
mtrMode = DispValues2Analog2
end if
end if
glcd_clear_screen()
end if
end procedure
procedure MainLoop is
SetMtrType()
if rotaryFunction != RotaryNull then
if (mtrMode == DispMenu) | ((menuPressed2 > 1) & (menuPressed2 <5)) | (rotaryFunction != RotaryPressed) then
HandleMenu()
else
if (menuPressed2 > 3) then
glcd_clear_screen()
glcd_char_goto(0,10)
if (isReverse == 1) then
isReverse = 0
print_string(glcd, msg6)
else
isReverse = 1
print_string(glcd, msg5)
end if
delay_1ms(500)
glcd_clear_screen()
else
if (toUHF == 1) then
toUHF = 0
else
toUHF = 1
end if
end if
end if
menuPressed1 = 0
menuPressed2 = 0
rotaryFunction = RotaryNull
end if
if red_on == 1 then
led_red = !led_red
led_green = 0
else
led_green = !led_green
led_red = 0
end if
red_on = 0
if (mtrMode == DispAnalog1Analog2) | (mtrMode == DispAnalog1Values1) | (mtrMode == DispAnalog1Values2) then
DrawMeter(0)
end if
if (mtrMode == DispAnalog1Analog2) | (mtrMode == DispValues1Analog2) | (mtrMode == DispValues2Analog2) then
DrawMeter(toLeft)
end if
MeasureADC()
if mtype1 == headIsHF then
if w1measure>900 then
if auto1_vo == 0 then
w1measure = 0
w2measure = 0
w3measure = 0
end if
auto1_vo = 1
mtr1_vo = 1
cnt1_vo = 20
else
if auto1_vo == 1 then
if w1measure<70 then
cnt1_vo = cnt1_vo - 1
if cnt1_vo < 1 then
auto1_vo = 0
end if
end if
end if
if auto1_vo == 0 then
mtr1_vo = (mpv_hf == 1)
end if
end if
w1measure = dword(w1measure * mpr_hf)/100
w2measure = dword(w2measure * mpr_hf)/100
end if
if mtype1 == headIs4M then
mtr1_vo = (mpv_4m == 1)
w1measure = dword(w1measure * mpr_4m)/100
w2measure = dword(w2measure * mpr_4m)/100
end if
if mtype1 == headIsVHF then
mtr1_vo = (mpv_vhf == 1)
w1measure = dword(w1measure * mpr_vhf)/100
w2measure = dword(w2measure * mpr_vhf)/100
end if
if mtype1 == headIsUHF then
mtr1_vo = (mpv_uhf == 1) | (toUHF==1)
w1measure = dword(w1measure * mpr_uhf)/100
w2measure = dword(w2measure * mpr_uhf)/100
end if
if mtype1 == headIsSHF then
mtr1_vo = (mpv_shf == 1)
w1measure = dword(w1measure * mpr_shf)/100
w2measure = dword(w2measure * mpr_shf)/100
end if
if mtype1 == headIsNC then
mtr1_vo = 0
w1measure = 0
w2measure = 0
end if
if mtype2 == headIsHF then
if w4measure>900 then
if auto2_vo == 0 then
w4measure = 0
w5measure = 0
w6measure = 0
end if
auto2_vo = 1
mtr2_vo = 1
cnt2_vo = 20
else
if auto2_vo == 1 then
if w4measure<70 then
cnt2_vo = cnt2_vo - 1
if cnt2_vo < 1 then
auto2_vo = 0
end if
end if
end if
if auto2_vo == 0 then
mtr2_vo = (mpv_hf == 1)
end if
end if
w4measure = dword(w4measure * mpr_hf)/100
w5measure = dword(w5measure * mpr_hf)/100
end if
if mtype2 == headIs4M then
mtr2_vo = (mpv_4m == 1)
w4measure = dword(w4measure * mpr_4m)/100
w5measure = dword(w5measure * mpr_4m)/100
end if
if mtype2 == headIsVHF then
mtr2_vo = (mpv_vhf == 1)
w4measure = dword(w4measure * mpr_vhf)/100
w5measure = dword(w5measure * mpr_vhf)/100
end if
if mtype2 == headIsUHF then
mtr2_vo = (mpv_uhf == 1) | (toUHF==1)
w4measure = dword(w4measure * mpr_uhf)/100
w5measure = dword(w5measure * mpr_uhf)/100
end if
if mtype2 == headIsSHF then
mtr2_vo = (mpv_shf == 1)
w4measure = dword(w4measure * mpr_shf)/100
w5measure = dword(w5measure * mpr_shf)/100
end if
if mtype2 == headIsNC then
mtr2_vo = 0
w4measure = 0
w5measure = 0
end if
pmcount1 = pmcount1 + 1
if pmcount1 > 20 then
pmcount1 = 0
w3measure = 0
end if
pmcount2 = pmcount2 + 1
if pmcount2 > 20 then
pmcount2 = 0
w6measure = 0
end if
if w1measure>w3measure then
w3measure = w1measure
pmcount1 = 0
end if
if w4measure>w6measure then
w6measure = w4measure
pmcount2 = 0
end if
-- Verwijder oude wijzers
glcd_pen_color = GLCD_WHITE
if (mtrMode == DispAnalog1Analog2) | (mtrMode == DispAnalog1Values1) | (mtrMode == DispAnalog1Values2) then
if o1measure!=w1measure then
RecalcXY(o1measure)
glcd_line(1,51,1+xpos,51-ypos)
glcd_circle(1+xpos,51-ypos, 1)
end if
if o2measure!=w2measure then
RecalcXY(o2measure)
glcd_line(62,51,62-xpos,51-ypos)
glcd_circle(62-xpos,51-ypos, 1)
end if
if o3measure!=w3measure then
RecalcXY(o3measure)
glcd_circle(1+xpos,51-ypos, 2)
end if
end if
if (mtrMode == DispAnalog1Analog2) | (mtrMode == DispValues1Analog2) | (mtrMode == DispValues2Analog2) then
if o4measure!=w4measure then
RecalcXY(o4measure)
glcd_line(1+toLeft,51,1+xpos+toLeft,51-ypos)
glcd_circle(1+xpos+toLeft,51-ypos, 1)
end if
if o5measure!=w5measure then
RecalcXY(o5measure)
glcd_line(62+toLeft,51,62-xpos+toLeft,51-ypos)
glcd_circle(62-xpos+toLeft,51-ypos, 1)
end if
if o6measure!=w6measure then
RecalcXY(o6measure)
glcd_circle(1+xpos+toLeft,51-ypos, 2)
end if
end if
glcd_pen_color = GLCD_BLACK
if (mtrMode == DispAnalog1Analog2) | (mtrMode == DispAnalog1Values1) | (mtrMode == DispAnalog1Values2) then
RecalcXY(w1measure)
glcd_line(1,51,1+xpos,51-ypos)
glcd_circle(1+xpos,51-ypos, 1)
RecalcXY(w2measure)
glcd_line(62,51,62-xpos,51-ypos)
glcd_circle(62-xpos,51-ypos, 1)
RecalcXY(w3measure)
glcd_circle(1+xpos,51-ypos, 2)
end if
if (mtrMode == DispAnalog1Analog2) | (mtrMode == DispValues1Analog2) | (mtrMode == DispValues2Analog2) then
RecalcXY(w4measure)
glcd_line(1+toLeft,51,1+xpos+toLeft,51-ypos)
glcd_circle(1+xpos+toLeft,51-ypos, 1)
RecalcXY(w5measure)
glcd_line(62+toLeft,51,62-xpos+toLeft,51-ypos)
glcd_circle(62-xpos+toLeft,51-ypos, 1)
RecalcXY(w6measure)
glcd_circle(1+xpos+toLeft,51-ypos, 2)
end if
o1measure = w1measure
o2measure = w2measure
o3measure = w3measure
o4measure = w4measure
o5measure = w5measure
o6measure = w6measure
if (mtrMode == DispValues1Values2) | (mtrMode == DispValues1Analog2) then
WriteValues(0,isMeter1)
end if
if (mtrMode == DispAnalog1Values1) then
WriteValues(toLeft,isMeter1)
end if
if (mtrMode == DispValues1Values2) | (mtrMode == DispAnalog1Values2) then
WriteValues(toLeft,isMeter2)
end if
if (mtrMode == DispValues2Analog2) then
WriteValues(0,isMeter2)
end if
if (mtrMode == DispMenu) then
WriteMenu()
end if
;delay_1ms(5)
end procedure
RCON_IPEN = 0
INTCON = 0b_1101_0000
INTCON2 = 0b_0000_0000
INTCON3 = 0b_0001_1000
forever loop
MainLoop
end loop