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

Back to Subject List

Thread Closed: Thread will re-open when original poster replies

???
04/13/07 15:26
Read: times


 
#137181 - And it might help to use hex
Responding to: ???'s previous message
when assigning a value to P1.

instead of
P1 = 10;
try
P1 = 0x10;

At least then you know what's on the various port pins without having to do a mental calculation of decimal to binary.

10 decimal = 0000 1010 binary
20 decimal = 0001 0100 binary

Better yet use 0xFF for the if and 0x00 for the else.

And make sure your port is configured correctly...



List of 12 messages in thread
TopicAuthorDate
if else statements in keil c51            01/01/70 00:00      
   Things to check            01/01/70 00:00      
      example            01/01/70 00:00      
   And it might help to use hex            01/01/70 00:00      
      floating point            01/01/70 00:00      
         Not true            01/01/70 00:00      
            further...            01/01/70 00:00      
   I suggest you read this..            01/01/70 00:00      
   Test Seems To Work            01/01/70 00:00      
      SDCC version works also            01/01/70 00:00      
         Testing the typo...            01/01/70 00:00      
   its a lot easier to use fixed point            01/01/70 00:00      

Back to Subject List