Download library here.

Check the tutorial page for an explanation about the virtual com-port.



USB VIRTUAL COMMUNICATION PORT

#include "string.h"
#include "LPC17xx.h"
#include "usbapi.h"
#include "usbvcom.h"
#include "stdlib.h"


#define BAUD_RATE    19200                        //Declare the communication speed.

int main(void)
{
    /* The following instructions are needed to set up USB in the main program */
    USB_init();
    VCOM_init();
    USBHwConnect(TRUE);

    /* Inifinite loop */
    while (1) {                                  


        if (VCOM_Available() != 0)                       //Check if there's data available.
        {
            char *variable1 = NULL;                      // Declare a pointer variable.
            variable1 = VCOM_RecieveString();       // Put the data in the variable.
            VCOM_putstring(variable1);                 // This is a command to write a sentence.
            VCOM_putstring("\r\n");                      // \r\n = go to new line            
        }
    }
}

Copyright 2011. Joomla 1.7 templates - Joomla template maker. The Simplecortex is developed by BRC-Electronics