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

rfreader

#include<reg51.h>
void boud_rate()
{
        SCON = 0x50;
        TMOD = 0x20;                /* timer 1, mode 2, 8-bit reload */
        TH1  = 0xFD;                /* reload value for 2400 baud */
        TR1  = 1;
        TI   = 1;
}
char serial_receive()
{
    char chr;        /* variable to hold the new character */
        while (RI != 1) {;}
        chr = SBUF;
        RI = 0;
        return(chr);
}

void main(void)
{

        boud_rate();
  unsigned char rx_data;

  for(;;)
  {
    rx_data = serial_receive();

    switch(rx_data)
    {
//      case '1': open_door();
          case 0067892341 : open_door();
        break;
//      case '9': open_door();
       case 0045780034 : open_door();
        break;

      default: dont_open();
    }

    proper_delay();
  }
}

errors

'rx_data':undefined identifier
 illigal octal digit

please tell me how to overcum these errors

Parents
  • You must be the only person in the history of humanity who uses an instrument of 100% fidelity.

    All instruments show a false picture, some are more false than others. No instrument ever showed, or will show 100% fidelity.
    sure, 100% is not reachable, I atually had an experience in the old TTL/455 days when the only scope that worked for a given glitch was the "DNA scope" We had to reason out way to where and what the glich was.
    HOWEVER, the more you see, the better off you are and buying something that is LIKELY to be "infidel" is not a good idea.

    Erik

Reply
  • You must be the only person in the history of humanity who uses an instrument of 100% fidelity.

    All instruments show a false picture, some are more false than others. No instrument ever showed, or will show 100% fidelity.
    sure, 100% is not reachable, I atually had an experience in the old TTL/455 days when the only scope that worked for a given glitch was the "DNA scope" We had to reason out way to where and what the glich was.
    HOWEVER, the more you see, the better off you are and buying something that is LIKELY to be "infidel" is not a good idea.

    Erik

Children
No data