Download library here.

These examples show how to use the serial interfaces on the Simplecortex.
Check the tutorial page for an explanation about DAC.

UART WRITE

#include "lpc17xx.h"
#include "lpc_types.h"
#include "uart.h"

int main (void)
{
   UART3_Init(9600);                                                   //Initialize UART 3  with a baud-rate of 9600

   while(1)
    {
        UART3_Sendchar(65);                                        //Use this command to send a byte
        UART3_PrintString("Simplecortex rules!\r\n");    //Use this command to send a strin
    }
}


UART READ

#include "lpc17xx.h"
#include "lpc_types.h"
#include "uart.h"

int main (void)
{
    UART3_Init(9600);                                                   //Initialize UART 3  with a baud-rate of 9600
    int var;                                                                      //Declare var for temporarily storage

    while(1)
    { 
        var = UART3_Getchar();                                      //Wait until data arrives and store it in var
    }
}


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