Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/04/08 02:30
Read: times


 
#159608 - Perception
Responding to: ???'s previous message
Hi Per,

I think you got quite irritated on so much discussion at such a basic issue !

Before I posted, sprintf() was one of option, except that I was doing it wrong. I did read the Help on sprintf / printf etc and I understood that I can use "X" or "x" to specify hex bytes. Came up with these "excellent" ones :

sprintf( ComString, "%h%h%h%h%h", 0x02,0x20,0x2E,0x2E,0x0D );
sprintf( ComString, "%H%H%H%H%H", 0x02,0x20,0x2E,0x2E,0x0D );

Obviously the results were disastrous.

A few hours later, after reading through the replies,I go it :

sprintf( ComString, "%c%c%c%c%c", 0x02,0x20,0x2E,0x2E,0x0D );

Contrary to general perception, I have got much faster replies from the 8052 forum.

Raghu


List of 13 messages in thread
TopicAuthorDate
Hex byte stream            01/01/70 00:00      
   Declare an initialised array            01/01/70 00:00      
      why not in code memory???            01/01/70 00:00      
   yes, if...            01/01/70 00:00      
      Initialized array            01/01/70 00:00      
         memcpy            01/01/70 00:00      
            Thanks.            01/01/70 00:00      
         You can build your array dynamically            01/01/70 00:00      
            sprintf ??            01/01/70 00:00      
               Manuals?            01/01/70 00:00      
                  Perception            01/01/70 00:00      
                     Bandwidth of facts            01/01/70 00:00      
                        You will make a good master !            01/01/70 00:00      

Back to Subject List