el_supremo:
The website I found about bitwise operators in C# shows that they are exactly the same as C, in which case they aren't difficult at all.
Not surprising. The "Arduino codes" don't work either. Where did you get that code from?Pete
As a agriculture mechanical eng. everything in this field is difficult to me. To be honest, I can do ok with Arduino after a year or two tinkering. With other languages, especially C# which I have just started 2 days ago, it was a bit too much. That's where I am atm.
I was trying to replicate same operation for C# but found out byte array not supported so there seems to be no simple way to get it work. I tried to learn related C# information yesterday afternoon. I will keep trying, like right now on Sat afternoon, but hope someone can help me to the right direction. You Don't Know What You Don't Know.
el_supremo:
The website I found about bitwise operators in C# shows that they are exactly the same as C, in which case they aren't difficult at all.
Not surprising. The "Arduino codes" don't work either. Where did you get that code from?Pete
You are right, that Arduino code did not work. It was probably one of many attempts I was trying for C#. My mind got stuffed up on Friday afternoon sorry.
Original code from http://www.leonardomiliani.com/en/2013/un-semplice-crc8-per-arduino/
//CRC-8 - based on the CRC8 formulas by Dallas/Maxim
//code released under the therms of the GNU GPL 3.0 license
byte CRC8(const byte *data, byte len) {
byte crc = 0x00;
while (len--) {
byte extract = *data++;
for (byte tempI = 8; tempI; tempI--) {
byte sum = (crc ^ extract) & 0x01;
crc >>= 1;
if (sum) {
crc ^= 0x8C;
}
extract >>= 1;
}
}
return crc;
}
Once again, appreciate any help.