I'm writing an Expression Chip that will make an action happen when there is a change in a set of buttons.
set-up:
Wheel (What will be triggered (as a beta))
[1] [2] [Expression Chip]
[3] [4]
[5] [6] [Timer] [CV - 1: 1]
[7] [8]
1-8 are buttons
The current script is:
[code]
@name Change In Buttons Pressed
@inputs Time Go B1 B2 B3 B4 B5 B6 B7 B8
@outputs Go Reset Clk1 Clk2
@persist Clk1 Clk2
[I]
if (Clk1 != Clk2) {
if (Go == 1) {
Go = 0
}
if (Go == 0) {
Go = 1
}
}
[/I]
if (Clk1 == Clk2) {
Go = Go
}
if (Time >= 0.2 & Time < 0.5) {
Clk1 = B1 + B2 + B3 + B4 + B5 + B6 + B7 + B8
}
if (Time >= 0.5 & Time < 0.7) {
Clk2 = B1 + B2 + B3 + B4 + B5 + B6 + B7 + B8
}
if (Time >= 0.7) {
Reset = 1
} else {
Reset = 0
}
[/code]
The italicized section is what I'm having trouble with. When I write the part in code for Go to change, either Go will stay at 0, or will get stuck on 1.
Codes I've Tried:
[code]
if (Clk1 == Clk2) {
Go == Go
} else {
if (Go == 1) {
Go = 0
}
if (Go == 0) {
Go = 1
}
}
[/code]
[code]
if (Clk1 != Clk2) {
if (Go == 1) {
Go = 0
}
if (Go == 1) {
Go = 1
}
}
[/code]
[code]
if (Clk1 != Clk2 & Go == 1) {
Go = 0
}
if (Clk1 != Clk2 & Go == 0) {
Go = 1
}
[/code]
I've probably tried more, but it's pretty much take offs of these.
Any ideas why it isn't working?
I'm pretty good at E2, but I have no fucking clue what you're asking. Add me on steam and I'll see if I can figure this shit out.
Sorry, you need to Log In to post a reply to this thread.