Problem with flipflop toggle object


#1

Hi,

I don't know if it's a bug or what. As you can see on the disp/bool , the flipflop toggle seems to be fine. But if I plug it on the led input, that doesn't work.
This is working if I plug it in the "/logic/or 2" and then to the led input.
I tried with "conv/to b" with no luck.

I'm on 1.0.10


Bools as 32-bit Integers
#2

Hi, could you share some details of the half-visible object that has all these led inlets? Because it seems that object is causing the issue somehow.


#3

Hi,
Here is the object :


#4

Ok, identified the issue, the problem is the not-very-clearly-defined semantics of boolean inlets.
The "74HC595inputsX4" object code assumes a value of 1 corresponds to true, but the correct assumption to make now is that value 0 is false and all other values correspond to true.
I suggest to change the code in your object from
outlet_outi=(inlet_led1|(inlet_led2<<1)|(inlet_led3<<2)|(inlet_led4<<3)...
to
outlet_outi=(inlet_led1?1:0)|(inlet_led2?1<<1:0)|(inlet_led3?1<<2:0)|(inlet_led4?1<<3:0)...

... moving this thread to the AxoObj coding category.


74HC595 object and high DSP load