I've a program in C++ which receive an array of chars.
char InputPacketBuffer[64];
Each value of the array has 8bits of ADC conversion that are sended from a microcontroler to the pc, but that chars are unsigned chars(0 to 256 value).
I want to manipulate the array to have a new array with unsigned chars, a new array of [64] with unsigned chars.
In the first (kooth) it builded, but it didn't work. I've a chart were I display the values, and I've 32 values received throw usb, forming a slope. When they are displayed the values above 127 are wrong, instead of being 28; 29; 30; 31 they are completely different.
In the second (webJose), the first case I got build error:
error C2440: 'initializing' : cannot convert from 'char [64]' to 'unsigned char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
and in the second case, buid error again:
error C2440: 'initializing' : cannot convert from 'char *' to 'unsigned char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
memcpy( ucBuffer, InputPacketBuffer, sizeof( ucBuffer ) );
worked =)
I wasn't diplaying the right array in my char, but the values saved on the file were ok.