Can 4 pins be added binary to decimal

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
markus747
Posts: 33
Joined: Mon Jul 23, 2012 7:17 pm
Location: Petaluma california USA
Has thanked: 26 times
Been thanked: 2 times
Contact:

Can 4 pins be added binary to decimal

Post by markus747 »

I need to add ( RB0 (1) + RB1 (2) +RB2 (4) + RD7 (8) )
to come up the binary weighted value
like is it possible to use pin names in a C# statement
like: (RB0 + (2*RB1)+(4*RB2) + (8*RD7) )
I'm trying to change some programs from Basic to C#
But I can't find any where on forum where people are referring to Pin Names, Is there a format for using pin names as values? or do pins need to be stored to a variable?
I would greatly appreciate some kind of sample of how to do something like this. :)

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Can 4 pins be added binary to decimal

Post by medelec35 »

Martin

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Can 4 pins be added binary to decimal

Post by Enamul »

Hi,

I have answered in the following post...
http://www.matrixmultimedia.com/mmforum ... 841#p41841
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply