After reading the link you gave I am afraid that I can not be of much help. I do not know anything about the xbox.
Here is what little I could figure out.
1 – The xbox button/switches must be pulled LOW foe something to happen.
2 – The information given about the project is incomplete, might make a good soldering tutorial.
3 – The code you have is not very good, even the author said it works MOST of the time.
I added some comments to the code you have. Hopefully it will explain some.
The DO-LOOP in stamp language is similar to WHILE..WEND in PBP but backwards.Code:' {$STAMP BS2} ' {$PBASIC 2.5} R PIN 15 ' R X Y G switches OR buttons on xbox? X PIN 14 Y PIN 13 G PIN 12 INPUT R 'in PBP same as TRIS?.? = 1 INPUT X INPUT Y LOW G 'is not used in program DO DO PAUSE 50 LOOP UNTIL IN7=1 'New switch ??? See comment below 'First R LOW R 'makes pin LOW (0) PAUSE 136 INPUT R 'in PBP same as TRIS?.? = 1 PAUSE 30 'Second R LOW R PAUSE 38 INPUT R 'X LOW X PAUSE 50 INPUT X PAUSE 210 'Double Y LOW Y PAUSE 50 INPUT Y PAUSE 50 LOW Y PAUSE 50 INPUT Y PAUSE 200 LOOP
IF-THEN-ELSE could also be made to work. The idea is to keep the program in a loop until a condition is met.
Suggestions to you.
1 – If you already have PBP, forget about trying to convert BS2 stuff from someone else.
2 – Study PBP and become comfortable with a hand full of LEDs and switches and a PIC or two.
3 – If you are planning on a project like this one, study the device. Web sites like the one you have been looking at are a waste of time.
The most important thing is not to give up. I have been playing with PICs for seven years now and I am still a beginner. Built a lot of “cool” things, but still a beginner.





Bookmarks