We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I wrote a small program to test the behaviour of 'printf' with unsigned char. It contained just the following loop: for (i=0; i<10; i++) { printf("i = %d\n", i); } Now when I watch the serial I/O window it gives me the following values: 0 256 512 768 1024 1280 and so on... I'm not worried about the value of 'i' because it seems to be OK when I set up a watch on it. Apparently its something to do with the way the char value is sent to the emulated serial port. I can observe the following behaviour: 0 = 00000000 00000000 --> to serial port 256=00000001 00000000 --> to serial port 512=00000010 00000000 --> to serial port now what I can't understand is why is the all zero byte being sent to the serial port first. Please enlighten me on this. Regards, Vipin Mehta
Mark, What I meant was, how do I get the percent to display correctly on this discussion forum - not how to get my 8051 to print it! Andy.
No need to yell, sorry for the misunderstanding. Here is 96%. I just typed it, no special characters. What language do you have set in your browser? - Mark
Sorry, didn't mean to yell. Tools/Internet Options/Languages says "Menus and dialog boxes are currently displayed in English (United States)" Under Fonts, script is set to "Latin based" with Web Font= Times New Roman and Plain Text Font= Courier New
Hey both Mark and Andy, You guys are so funny. What do you see '%'? Some times I see a percent sign and sometimes I see 96. I think our eyes some times make us look silly...:) --Zhi
I think I've rumbled it: The nice man at Keil has pointed out to me (off-list) that the "96" really is a percent '%' - it's just that the font used by the board has a particularly bad rendition of the '%' character which looks just like "96" However, in the message composition window, it uses a different font - which has a decent percent character:
'%'