QTI problem
Hoffa
Posts: 46
Hi
I´m trying to translate my bs2 QTI program to Propeller, but it won´t work. Someone have any idea what I´m doing wrong?
BS2:
Propeller:
/Hoffa
Post Edited (Hoffa) : 1/7/2008 10:30:31 AM GMT
I´m trying to translate my bs2 QTI program to Propeller, but it won´t work. Someone have any idea what I´m doing wrong?
BS2:
qtiLeft VAR Bit qtiCenter VAR Bit qtiRight VAR Bit DO HIGH 5: PAUSE 1: qtiRight = IN3: INPUT 5 HIGH 6: PAUSE 1: qtiCenter = IN3: INPUT 6 HIGH 7: PAUSE 1: qtiLeft = IN3: INPUT 7 DEBUG HOME, BIN1 qtiLeft, BIN1 qtiCenter, BIN1 qtiRight PAUSE 100 LOOP
Propeller:
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 inPin = 18 firstPin = 19 numPin = 5 OBJ clock : "Clock" text : "VGA_TextOut" PUB start | i, ans text.start init repeat repeat i from 1 to numPin outa[noparse][[/noparse]firstPin+i]~~ clock.PauseMSec(1) ans := ina[noparse][[/noparse]firstPin] outa[noparse][[/noparse]firstPin+i]~ text.printNum(ans) clock.pausesec(1) text.CLS PUB init | i dira[noparse][[/noparse]firstPin]~ repeat i from 1 to numPin dira[noparse][[/noparse]firstPin+i]~~
/Hoffa
Post Edited (Hoffa) : 1/7/2008 10:30:31 AM GMT
Comments
(b) You outenable pins "FirstPin" plus 5 further.. Shouldn't that be 4 further only? Your loop in "init" looks awkward.. You know you can start it with zero, don't you?
(c) I do not know what BASIC INPUT 5 does... Can it be it sets the port to TriState? If yes, you should modify DIRA rather than OUTA for that...
Post Edited (deSilva) : 1/7/2008 8:55:31 PM GMT
I use this code:
If I try this code but with just one QTI it works fine. But when I use two they interact with each other. When one (or both) sees white both indicates 0, if both sees black both indicates 1.