NEWS
(erledigt)Hilfe bei Bit operation and / or
-
Hallo,
brauch mal wieder eure hilfe bei einer Bitoperationbit 7 6 5 4 3 2 1 0 x x x x x 1 x 1 | x x x x x 0 x 1 | Ergebis immer true x x x x x 1 x 0 | x x x x x 0 x 0 | false a = inputwert & 4 b = inputwert & 1 c = a + b if c = 0 dann false else true
wie schreibt man das vernünftig?
-
@ubecker
Mindestens ein Bit korrekt gesetztResult = (inputwert & 5) != 0
Alle Bits korrekt gesetzt
Result = (inputwert & 5) == 5
-
@asgothian said in Hilfe bei Bit operation and / or:
Result = (inputwert & 5) != 0
danke, das hab ich gesucht.
-
@ubecker Noch ein Thema dazu? Was hatte Dir denn hier bei den ganzen Beispielen gefehlt? https://forum.iobroker.net/topic/73495/erledigt-bitweise-and-in-blockly
-
@haus-automatisierung da hast du ja Recht, im Prinzip ist da alles. Mein Problem ist das ich die Syntax von JS noch nicht drin habe und mich damit schwer tue. Manchmal aber auch in Umwegen denke. Ich habe erst im November letztn Jahr mit IOBroker angefangen und da dann erste mal mit JS zu tun gehabt habe. Mein Schwerpunkt ist Hardware und nicht Software. Dafür läuft bei mir mittlerweile MQTT, Modbus, HM, HMIP, Z-Wave.
Ich werde mich wohl noch mehrmals melden müssen.
danke für die noch kommende Unterstützung.