hi everyone, my problem may be simple but i cannot figure it out. I am sending 0x01 to arduino using a C# application and arduino reads it as 255 when I use int(incomingByte). It is 255 in every different value. For example I send 0xF2. It is 255 again. I even tried manual conversion from byte to int by multipliying pow(2,bitnumber)*bitRead(incomingByte(bitnumber)) it still reads it as 255. I wrote the value to sd card so that I can remove sd card and look at the value. What might be the problem ?
Serial data is not faulty. Because I send 0xCC to arduino and if the coming data is 0xCC, then arduino sends 0xCC back. I recieve the echo.