This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sending a bit of a char ro any port pin

Dear friends

i would like to know how to send any bit of a char
to any port pin
ie. unsigned char a = 0xAA; now at memory location for a will contains 10101010b can i send the bit 0 of "a" to P1_0? i don't want to send the entire a to P1

thanking you

sunish

Parents
  • yavuz,
    obviousely, you cannot infinitely increase the size of your buffer! that is a big problem indeed! I have corrected your code below to make is circular buffer. there are of course many other options!

    char MyBuffer[20],output;  // buffer and current display output
      int i=0;   // counter
    
      while (output != '$')  // "$" key is the end of dos string
      {
        MyBuffer[i % 20] = output;
        i++;
      }
    

Reply
  • yavuz,
    obviousely, you cannot infinitely increase the size of your buffer! that is a big problem indeed! I have corrected your code below to make is circular buffer. there are of course many other options!

    char MyBuffer[20],output;  // buffer and current display output
      int i=0;   // counter
    
      while (output != '$')  // "$" key is the end of dos string
      {
        MyBuffer[i % 20] = output;
        i++;
      }
    

Children