Software Program


Introduction |  Mechanical Design |  Electrical Design |  Micro-controller | System Operations | Conclusion and Findings |  The Team

'this program samples the input and if three in a row are a 1 or a 2 then it is output.
'if three in a row are a 3 then it is not output,
'and if six in a row are a 0 then it is output.

5 PRINT "******** EMG FILTER PROGRAM ********"
6 PRINT " GROUP 339"
7 PRINT "JERRY FULLER/PATRICK OGRADY/STUART RICKARD"
8 PRINT "04-08-03"
9 PRINT : PRINT : PRINT 
10 XBY(61955)=128 ' sets the input and output card addresses
20 DIGIN=XBY(61952) ' gets a sample from the input card
30 TEST1=DIGIN ' stores sample value in test1
35 DIGIN=XBY(61952) ' gets a sample from the input card
40 TEST2=DIGIN ' stores sample value in test2
45 DIGIN=XBY(61952) ' gets a sample from the input card
50 TEST3=DIGIN ' stores sample value in test3
54 SUM=TEST1+TEST2+TEST3+SUM ' adds the three values to sum
55 IF SUM>=1 THEN GOTO 60 ' loops back if the sum is still 0
56 FIRST=FIRST+1 ' adds one to the loop counter first
57 IF FIRST=1 THEN GOTO 20 ' loops back if first time through loop
58 GOTO 90 ' if it's second time through and sum is still 0 then a 0 is output
60 IF TEST1=TEST2 THEN GOTO 80 ' if test1 and test2 are different them loop back and resample
69 GOTO 20
80 IF TEST2=TEST3 THEN GOTO 82 ' if test2 and test3 are different them loop back and resample
81 GOTO 20
82 IF TEST1=3 THEN GOTO 20 ' if the input value is a three then resample
90 XBY(61953)=TEST1 ' if all conditions are met then output the sampled value
92 SUM=0 ' reset the sum
95 GOTO 20 ' loop to resample
100 END