I am trying to write and read bytes from usb device. I have an array dout(8) of boolean say f,t,t,f,t,t,f,t representing switch states. I need to convert that to a variable DataOu开发者_运维知识库t as byte. 01101101
Later I read the usb device. This gives me a variable Data as byte 10110100 I need to convert that to an array DIn(10) of boolean t,f,t,t,f,t,f,f
All my code attempts have failed.
Try the System.BitConverter class.
If you don't want to worry about thinking in binary, there is a class called BitArray that will help you.
精彩评论