BS1 Code Help
Blackbird455
Posts: 124
OK, let me try this again,
·
·· I want to install a single button on a bs1 , that when pressed, will cause it to run a different set of instructions each time, say 4 different sets,
(FIRST SET)
SYMBOL reps = W1
SYMBOL i = W1··················· ' FOR...NEXT loop counter
Main:
FOR reps = 0 TO 65535 STEP 3000
FOR i = 1 TO 30
TOGGLE 2
PAUSE 18
NEXT
PAUSE 8
FOR i = 31 TO 60
TOGGLE 4
PAUSE 18
NEXT
PAUSE 8
NEXT
(SECOND SET)
FOR i = 1 TO 10
TOGGLE 2
PAUSE 40
NEXT
PAUSE 8
FOR i =·11 TO 20
TOGGLE 4
PAUSE 40
NEXT
PAUSE 8
NEXT
AND SO ON.....
How would I do this?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
·
·· I want to install a single button on a bs1 , that when pressed, will cause it to run a different set of instructions each time, say 4 different sets,
(FIRST SET)
SYMBOL reps = W1
SYMBOL i = W1··················· ' FOR...NEXT loop counter
Main:
FOR reps = 0 TO 65535 STEP 3000
FOR i = 1 TO 30
TOGGLE 2
PAUSE 18
NEXT
PAUSE 8
FOR i = 31 TO 60
TOGGLE 4
PAUSE 18
NEXT
PAUSE 8
NEXT
(SECOND SET)
FOR i = 1 TO 10
TOGGLE 2
PAUSE 40
NEXT
PAUSE 8
FOR i =·11 TO 20
TOGGLE 4
PAUSE 40
NEXT
PAUSE 8
NEXT
AND SO ON.....
How would I do this?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
Comments
if in0 = 1 then set2
if in0 = 1 then set3
if in0 = 1 then set4
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
One thing is for certain. You shouldn't be assigning BOTH the variables reps and i to the same internal register (W1). One is going to clobber the other, and nothing will make sense.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thats code that I took and modified.....I don't even know what that is !!!!!!!! lol what do you suggest?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
I understand the IN0 lines, but take my code and show me where to put all that.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
does this help?· the sets are subroutines.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
There are more efficient ways to do this, but this is simple and, hopefully, clear.
I have not tried this with the editor ... It may not be quite correct ... "Your mileage may vary".
Post Edited (Mike Green) : 8/29/2007 7:15:06 PM GMT
Will try it when I get back
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
I would replace the following WORD variable assignment:
SYMBOL i = W1 ' FOR...NEXT loop counter
with this BYTE variable assignment:
SYMBOL i = B4 'FOR...NEXT loop counter - BYTE-sized (0-255)
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
yes I did change SYMBOL definitions..........when I tokenize........."label is missing" between (action = action + 1)???? I have no idea.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
Here is a link to one place you can get it:
marwww.in2p3.fr/~levansuu/projets_es2i/Parallax/parallax%20website/stamps/stampdocs.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
You need to familiarize yourself with the processor and programming language you want to use. You might as well stop professing ignorance and get to work.
I guess, to sum it all up..............IF you want to help me, tell me exactly where I can find what I need, or just show me yourself........IF NOT........do not waste your time and my time and Parallax's server disc space.
Thank you,
Dan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy
If you expect others to hand you complete information, you will occasionally find it here, but most of us don't have the time or interest to do that amount of work. Occasionally our interest is piqued by someone's description of a project and we'll put in a remarkable amount of effort to help out, but don't expect it.
Post Edited (Mike Green) : 8/31/2007 8:37:23 PM GMT
Thats the 90-10 that I am talking about..........I just wanted a basic example of code, that I could expand upon.........THIS is what I am talking about........Had you defined "action" I would have taken notice of it, and forever stored that little bit of information in the "knowledge gained" crevise of my brain.
I have never done any exercises in SYMBOL definition, as my programs are generally not that complex........... now I know, since it has been brought to my attention, how to define symbols, because I followed the link that RLD2004 posted, that was very helpful.
"If you expect others to hand you complete information, you will occasionally find it here, but most of us don't have the time or interest to do that amount of work."
1. There has been more time and energy expended here on this topic than if someone had written the code from scratch, built a BS1 OEM, from scratch, plugged in the components, tested , and posted the results.
2. Mike, I would appreciate it if you would stop assuming what I am thinking, and expecting...........Makes me think of what my latin teacher would always say about the word "assume"........... I do understand the purpose of this forum, and I don't expect others to go to work for me and hand me "complete" information. I regret that you interpret my intentions in this way.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy