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

MicroController Connection

Any one know how my program should be like when i need to pass in information for example "a" and display it in a display box... through serial communication.

Parents
  • You can set up the serial port of the microcontroller (lots of example programs use it so that should be no problem) and use a function like scanf() or getchar() (both from STDIO.H) to load a character into the microcontroller via the COM-port.

    It could look like:

    unsinged char first, second, third;
    
    scanf("%c %c %c",&first, &second, &third);
    

    This program reads the serial port for 3 characters and loads their values in first, second and third.

    Regards and good luck,
    Laurens Swaans

Reply
  • You can set up the serial port of the microcontroller (lots of example programs use it so that should be no problem) and use a function like scanf() or getchar() (both from STDIO.H) to load a character into the microcontroller via the COM-port.

    It could look like:

    unsinged char first, second, third;
    
    scanf("%c %c %c",&first, &second, &third);
    

    This program reads the serial port for 3 characters and loads their values in first, second and third.

    Regards and good luck,
    Laurens Swaans

Children