Posted: 01:32am 25 Nov 2011 |
Copy link to clipboard |
Print this post |
|
Gents,
Is there a more elegant way to write this code?
It’s just meant to toggle each MM pin high for ½ second, continuously as a test.
I haven't actually tried it as such but I guess it should work.
Thanks
Talbit
10 FOR i = 1 TO 20 : SETPIN i, 8 : NEXT i
20 Pin (1)=1
30 PAUSE 500
40 PIN (1)=0
50 Pin (2)=1
60 PAUSE 500
70 PIN (2)=0
80 Pin (3)=1
90 PAUSE 500
100 PIN (3)=0
110 Pin (4)=1
120 PAUSE 500
130 PIN (4)=0
140 Pin (5)=1
150 PAUSE 500
160 PIN (5)=0
170 Pin (6)=1
180 PAUSE 500
190 PIN (6)=0
200 Pin (7)=1
210 PAUSE 500
220 PIN (7)=0
230 Pin (8)=1
240 PAUSE 500
250 PIN (8)=0
260 Pin (9)=1
270 PAUSE 500
280 PIN (9)=0
290 Pin (10)=1
300 PAUSE 500
310 PIN (10)=0
320 Pin (11)=1
330 PAUSE 500
340 PIN (11)=0
350 Pin (12)=1
360 PAUSE 500
370 PIN (12)=0
380 Pin (13)=1
390 PAUSE 500
400 PIN (13)=0
410 Pin (14)=1
420 PAUSE 500
430 PIN (14)=0
440 Pin (15)=1
450 PAUSE 500
460 PIN (15)=0
470 Pin (16)=1
480 PAUSE 500
490 PIN (16)=0
500 Pin (17)=1
510 PAUSE 500
520 PIN (17)=0
530 Pin (18)=1
540 PAUSE 500
550 PIN (18)=0
560 Pin (19)=1
570 PAUSE 500
580 PIN (19)=0
590 Pin (20)=1
600 PAUSE 500
610 PIN (20)=0
620 Goto 20
Talbit |