
|
INFO - FAQ - CC2-Forum - CCPro-Forum |
|
Hier ist mein Kode, der zusätzlich noch erkennen kann, ob ein Schalter durch Prellen Unsinn ausgibt. Dadurch ist keine Pause notwendig. Es werden max. 10 Impulse pro Sekunde erkannt. Grüße Andy ax=0 bx=0 #start1 a=port1 b=port2 if (ax=a) and (bx=b) then goto start1 if (ax<>a) and (bx<>b) then goto start1 c=1 if a=b then goto ab if (ax=a) and (bx<>b) then c=-1 goto ab1 #ab if (ax<>a) and (bx=b) then c=-1 #ab1 ax=a bx=b d=d+1 'nur jeder 2. Impuls ist ein Schritt if d<2 then goto start1 d=0 'Als Beispiel-> Rechtsdrehen=1, Linksdrehen=2 if c=1 then print "1" else print "2" goto start1 |
| Antwort schreiben |