SHENZHEN I/O

SHENZHEN I/O

View Stats:
How to create an if/else if conditional group? Re: Virtual Reality Buzzer
I'm working on the Virtual Reality Buzzer project and I'm having issues working with the radio -rx inputs.

This is my code:
teq x0 1
+ add 1
= teq x0 0
+ sub 1

The above was hoped that when radio-rx is set to 1 the acc register would only be incremented. But what I'm seeing is when 1 is given both the add and sub commands are run, negating the intended result.

I regret I haven't figured out how to tweak it to where the first 2 lines ONLY react with a 1 input, while the last two lines react only to a 0 input

The reason I feel this is needed is the fact it seems the only way to ensure a capture of all inputs is to have the testing be in a single conditional group. Otherwise it's possible to miss key inputs.

Do you guys have any suggestion?

Thank you
< >
Showing 1-1 of 1 comments
Kalle 10 Sep @ 9:31am 
There are several ways to solve it. One would be something like:
tcp x0 0
+ add 1
+ jmp e
- jmp e
sub 1
e: do something

You can only read the x-bus input once.
< >
Showing 1-1 of 1 comments
Per page: 1530 50