Dan Mulally wrote: > > I'm trying to send 8 bit data from the 10 bit A/D of a PIC16F873 to a > PIC16F874. I'm using the CCS PCM C-compiler. I'm truncating the data by > doing two right shifts and then try to send the 8 bits out the RS232. My > problem is trying to format the data so that it's simply sent as an 8-bit > value instead of ASCII charaters. My latest attempt is but the data ends up > being sent as ascii charaters instead of just an 8 bit value. Any help would > be greatly appreciated: > > This program sends joystick data out the serial port > // when you dont typecast it the MSB just gets lopped off. value_8bit= value; // truncate long int printf( "%c", (int) value); // print it as a character I know it sounds crazy but if you take an 8bit value say 65 thats an 'A' (I have no real idea but it could be any character) ok so you have: long value; value=65; printf("%d",(int)value); thats a 2 calls to get the ascii representation of the 65 so a '6' and a '5'; if you just printf("%c",(int)value); then that just sends a 65 out the port.