Bi0haZarD Posted March 14, 2008 Share Posted March 14, 2008 (edited) nevermind.. i figured it out :p <--- is an id-10-t :p Edited March 14, 2008 by Bi0haZarD Link to comment https://www.neowin.net/forum/topic/625604-c-convert-byte-to-binary/ Share on other sites More sharing options...
0 garethevans1986 Posted March 26, 2008 Share Posted March 26, 2008 Could you write up what your problem was and how you figured it out please.....just for future reference and other users! GE Link to comment https://www.neowin.net/forum/topic/625604-c-convert-byte-to-binary/#findComment-589293335 Share on other sites More sharing options...
0 Bi0haZarD Posted March 28, 2008 Author Share Posted March 28, 2008 sure, but doubt this will help others.. Needed this for a program i was writing to turn on 8 separate LED's attached to my parallel port. (heres a video of it.. http://www.youtube.com/watch?v=Fq-TzxaW-IQ ) this code was to get the status off the parallel port (which Inp32() returns as a byte value (0 - 255)) to a Binary value.. so I'm willing to bet this will need to be modified for others to get it to work... and the Binary is probably reversed.. i lost interest in making this since i don't have a 25 pin cable to take the parallel port from the back of my comp to the front... at least not yet.. only cable i have is a 25 male to male cable which i don't want to destroy. void monitor(object o2, EventArgs e2) { string binary = ""; byte bite; bite = Inp32(Program.address); for (int i = 0; i <= 7; i++) { if ((bite & (int)Math.Pow(2, i)) != 0) { binary += "1"; Program.chkBox[i].Checked = true; } else { binary += "0"; Program.chkBox[i].Checked = false; } } toolStripStatusLabel1.Text = binary + " [" + bite +"]"; } Link to comment https://www.neowin.net/forum/topic/625604-c-convert-byte-to-binary/#findComment-589297386 Share on other sites More sharing options...
0 garethevans1986 Posted March 28, 2008 Share Posted March 28, 2008 You could also get a converter.....but seeing as those cables arent used as much now I suppose you could grab one on the cheap.....if your desperate try ebay! GE Link to comment https://www.neowin.net/forum/topic/625604-c-convert-byte-to-binary/#findComment-589297776 Share on other sites More sharing options...
0 Bi0haZarD Posted March 28, 2008 Author Share Posted March 28, 2008 You could also get a converter.....but seeing as those cables arent used as much now I suppose you could grab one on the cheap.....if your desperate try ebay!GE yea i was thinkin about that, (they're called Gender Changers. and would need one for DB25 (25 pin Parallel Port)) The radio shack nearby doesn't carry them, and no other stores that would carry them nearby.. but probably just gonna order one online.. My initial theory for this project was simple... 8 LED's.. assign 1 LED per friend.. then have my program get unread IM's from Pidgin (probably code a plugin to do that).. and light the LED for that friend (mainly so i don't have to minimize the game i'm playing to see who IM'ed me)... or even take it further and do other simple stuff like Download Progress... 2 LEDs = 25%, 4 LEDs = 50%, 8 LEDs = 100%.. Link to comment https://www.neowin.net/forum/topic/625604-c-convert-byte-to-binary/#findComment-589297815 Share on other sites More sharing options...
Question
Bi0haZarD
nevermind.. i figured it out :p
<--- is an id-10-t :p
Edited by Bi0haZarDLink to comment
https://www.neowin.net/forum/topic/625604-c-convert-byte-to-binary/Share on other sites
4 answers to this question
Recommended Posts