assurance-tunnel
assurance-tunnel
assurance-tunnel
assurance-tunnel

# Decimal to binary

• Dear all,

It's my first-time use javascript actor, I try to write a decimal to binary actor but I think it over my skill. (I haven't learn java yet...)

Is there anyone can help?

I would like to input number range 0-360 (decimal), then output binary 000000000~000101101(binary).

Thank you!!!

HY

• @huangyi

Here you go. decimalToBinary.izz

Best Michel

• Thank you so much Michel!!!

But my version is 2.61, how can I get newer version? ~@@~

HY

Best Michel

• Thank you so much Michel! It works!

Is it possible to program it to keep export 9 numbers? say 0 = 000000000, 1 = 100000000, 359 = 111001101

Please correct me if I am wrong!

And is there any way that to transfer the number to text? so I can chop the number that I want to send to other actors? It appear differently with number to text actor.

Thank you again!

Wishes,

HY

• @huangyi have a look at this patch you will find michel example modified to output a string

and some other actors that will already decode the bits and output them as 0/1 or on/off

best clemens

dec_binary_ck.izz

• probably I miss something but is I enter 512 (increasing the number of bits ) the javascripts and the text actor return all 0s

what am I missing?

• @maximortal

Well the problem with the modified patch is that its limited to output 9 numbers only, the first number gets chopped off. You have to go into the JavaScript actor and change (-9) to (-10).

Best Michel

• @Maximortal 512 is using the 10th bit so it wouldn't show up in the actors as they are hardcoded to 9 bits as requested by hunagyi

best clemens

• Just because we are talking about binary here.

I found a video on youtube explaining binary, its in german but I guess even just the pictures explain it without understanding the language. Its the best I have seen.

if you don't understand German start watching from 1min 12seconds.

• Thank you, Michel and m_theater!!!

It works perfectly!
I hope I understand German; the video described so beautifully.

Will share with you that I use Isadora to control a turntable!
The actor you wrote which is for the position the 360 degrees of the turntable. Without this actor, I need to type in the binary numbers manually. This actor improved the workflow very much!

I used to ask the turntable engineer to includes this code in their system, but they didn't. Now I luckily improved my coding skill.

Thank you again!

HY

• @huangyi

That sounds awesome! It'd be great to see it in action too! We'd love it if you could tag us when and if you share any photos or videos on social media so that we can share them with our followers too. We're always excited to see what our users around the world create with Isadora and love to celebrate our community! #troikatronix