Go Down

Topic: How to convert a number to binary ? (Read 1 time) previous topic - next topic

AWOL

Quote
Yes I know. Serial.print(y,bin).

Close, but no cigar.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Chipakias


Quote
Something else I would like to know is about how can I separate a 16 bin value of a variable into
2 8bin variables. For example  x = 0B1111111100000001, I would like  y to be 0B11111111 and
z = 0B00000001 in order to send them with shiftout (using 2 shift registers) to another chip.

So, you WERE able to find the reference page. Too bad you didn't spend just a little bit longer there. That's a page well worth spending more then 2 minutes at. You should at least familiarize your self with the available functions, even if you don't study things like highByte and lowByte. Just knowing that they are there is useful.


You are right. I had to search more the reference page. It is in my plans. Thank you very much for your response. You helped me a lot and I understood many things!

Chipakias


Quote
Yes I know. Serial.print(y,bin).

Close, but no cigar.


You also helped me a lot, it tooks me enough time to understand byte behavior and how to print it . Also sorry for my late response.

Go Up