Ok, CPU is hard if you have zero experience with programming or eaven basic "computer" logic...
However, the e-gate is easier than the CPU.
And this is how it would work for you...
Code:
N@Input gate
I@B1 B2 B3 B4 B5 B6 B7 B8 B9 B0
O@Value
(~B1 & B1) -> I = 1, Pressed = 1;
(~B2 & B2) -> I = 2, Pressed = 1;
(~B3 & B3) -> I = 3, Pressed = 1;
(~B4 & B4) -> I = 4, Pressed = 1;
(~B5 & B5) -> I = 5, Pressed = 1;
(~B6 & B6) -> I = 6, Pressed = 1;
(~B7 & B7) -> I = 7, Pressed = 1;
(~B8 & B8) -> I = 8, Pressed = 1;
(~B9 & B9) -> I = 9, Pressed = 1;
(~B0 & B0) -> I = 0, Pressed = 1;
Pressed -> Digit += 1, Value = (Value + (10^Digit)) + I, Pressed = 0;
Tell me if that works, otherwise i messed something up.
But it works in theory![/b]
I will also go out and say that the code should work, however, I see no 'clear' button, I'll try my hand at adding one (Ironically, I won't even have wiremod until christmas, but eh)
Code:
N@Input gate
I@B1 B2 B3 B4 B5 B6 B7 B8 B9 B0 Rst
O@Value
(~B1 & B1) -> I = 1, Pressed = 1;
(~B2 & B2) -> I = 2, Pressed = 1;
(~B3 & B3) -> I = 3, Pressed = 1;
(~B4 & B4) -> I = 4, Pressed = 1;
(~B5 & B5) -> I = 5, Pressed = 1;
(~B6 & B6) -> I = 6, Pressed = 1;
(~B7 & B7) -> I = 7, Pressed = 1;
(~B8 & B8) -> I = 8, Pressed = 1;
(~B9 & B9) -> I = 9, Pressed = 1;
(~B0 & B0) -> I = 0, Pressed = 1;
(~Rst & Rst) -> I = 0, Pressed = 0; Value = 0; Digit = 0;
Pressed -> Digit += 1, Value = (Value + (10^Digit)) + I, Pressed = 0;
Bookmarks