To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 2272
    converting binary to integer —Keith the wonder wookie
   I am reading four digital inputs and I need a way to convert those four bits into a decimal number. Is there an easy way to do it. Thanks. Keith Keith Soldavin kas219@email.psu.edu (URL) (27 years ago, 4-Jun-97, to lugnet.robotics.handyboard)
   
        Re: converting binary to integer —Jeff Keyzer
   (...) Multiply each bit by 2^n, where n is the "place" of the number. Then add the products together. For example... 1011 = 1*2^0 + 1*2^1 + 0*2^2 + 1*2^3 = 11 The "zero" place is the one furthest to the right, and you work left from there. ---...--- (...) (27 years ago, 4-Jun-97, to lugnet.robotics.handyboard)
 

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR