PBASIC Programming/PBASIC Editor

From Wikibooks, open books for an open world
< PBASIC Programming
Jump to navigation Jump to search

' Cizgin03 Program ' {$STAMP BS2} ' {$PBASIC 2.0} OUTPUT 4 OUTPUT 5 INPUT 0 INPUT 1 INPUT 2 i VAR Byte ' '------------- basla: IF IN7=1 THEN ileri IF IN8=1 AND IN7=0 AND IN6=0 THEN sagsensor IF IN8=1 AND IN7=1 THEN sagsensor IF IN6=1 AND IN7=1 AND IN8=1 THEN ileri IF IN6=1 AND IN7=0 AND IN8=0 THEN solsensor IF IN6=1 AND IN7=1 THEN solsensor IF IN6=0 AND IN7=0 AND IN8=0 THEN durum '------------- ileri: PULSOUT 0,500 PULSOUT 1, 1000 GOTO Basla '------------- solsensor: i=1 GOTO basla '------------- sagsensor: i=3 GOTO basla '------------- durum: IF i=1 THEN solsen IF i=3 THEN sagsen GOTO basla '------------- solsen: i=1 GOTO basla '------------ sagsen: i=3 GOTO basla END