As an old vb.net programmer I just reloaded my old netduino classic with the latest Firmware and start writing some test-programs to control my led-matrix mentioned in another thread.
However, I'm stuck at the following code:
Public Sub SetBit(ByRef byteToAlter As Byte, bitPosition As Integer, bitValue As Integer) Select Case bitValue Case 1 Dim mask As Byte = 1 << bitPosition 'if bitPosition is 3, mask results in 00001000 byteToAlter = byteToAlter Or mask Case 0 Dim mask As Byte = 255 - (1 << bitPosition) ' if bitPosition is 3, mask results in 11110111 byteToAlter = byteToAlter And mask End Select End Sub
This one works fine in VB.net (full Framework) but not in MF. 1 << bitposition is not supported.
If I try to write this part in c# (1 <<= bitPosition) it works as expected.
But I don't want to write the entire stuff in c# (hmm, might be better ) so it must be possible to do this sort of bitshifting in vb.
Thanks and regards