#include <stdio.h>
#include "serial_read.h"

int main()
{

  UART *pUart; /*Create a pointer to a UART struct, needed by SerialInit*/
  pUart=SerialInit();
  if(pUart == 0)  //pUart is a pointer, if it is 0 it is a null pointer. That means something went wrong in SerialInit
  {
    printf("Error Opening Sensor\n");
    return EXIT_FAILURE;
  }
  // If we are here, we have an open serial stream pointed to by pUart.
  int i = ReadSerial(1,pUart);  //Let's read the value of the sensor on port 1.
  printf("Serial Value: %d\n",i);
  //If CloseSerial were implemented, it would go here.
  return EXIT_SUCCESS;
}
