How do I write this in VB, it's from a arduino site.
In Arduino
ReadByte &= ~(1 << 7);
thank you, Ellen
Bit shifting
Started by Ellen, Sep 09 2012 08:19 AM
3 replies to this topic
#1
Posted 09 September 2012 - 08:19 AM
#2
Posted 09 September 2012 - 10:31 AM
hi ellen
The bb bitwise operators are listed here http://msdn.microsof...a(v=vs.80).aspx
that should help in translating the arduino c to vb
Nak.
The bb bitwise operators are listed here http://msdn.microsof...a(v=vs.80).aspx
that should help in translating the arduino c to vb
Nak.
#3
Posted 09 September 2012 - 01:21 PM
Hi Ellen,
The visual basic bit shift operator is here: << operator
The visual basic bit-wise not "~" appears to be "Not": Logical and bitwise not
So I think you can write something like this:
a = Not(b << c)
I did not spot an &= equivelant, I guess you have to write it long hand!
a = a And Not(1 << 7)
Hope this helps - Paul (who is not a VB expert)
If I'm wrong, tell me so I can edit the post.
EDIT: removed semicolon. (thanks supra)
The visual basic bit shift operator is here: << operator
The visual basic bit-wise not "~" appears to be "Not": Logical and bitwise not
So I think you can write something like this:
a = Not(b << c)
I did not spot an &= equivelant, I guess you have to write it long hand!
a = a And Not(1 << 7)
Hope this helps - Paul (who is not a VB expert)
If I'm wrong, tell me so I can edit the post.
EDIT: removed semicolon. (thanks supra)
#4
Posted 10 September 2012 - 10:58 AM
remove colon
a = a And Not(1 << 7);
to
a = a And Not(1 << 7)
BTW, I can even converted frm proteus, mplab, mikroC/mikroBasic to VB.Net
a = a And Not(1 << 7);
to
a = a And Not(1 << 7)
BTW, I can even converted frm proteus, mplab, mikroC/mikroBasic to VB.Net
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users