/******************************************************************
* Copyright (C) 2009 Ram Narula
* Filename: main.cpp
* Version: 0.11
* Date: 16 July 2009
* Information: http://www.xduino.com/
******************************************************************/
/******************************************************************
* This file is part of Xduino
*
* Xduino is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xduino is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Xduino. If not, see .
******************************************************************/
/* Xduino library initialization */
#include "main.h"
int LedPin = PB7; // as labelled on your ARM Cortex-M3 board
int main(void)
{
doInit(); //Initialize
Serial1.begin(115200); //USART1
Serial1.println("Starting Xduino example...");
pinMode(LedPin,OUTPUT);
for(int i=1;i<=10;i++)
{
digitalWrite(LedPin,HIGH);
delay(200);
digitalWrite(LedPin,LOW);
delay(200);
}
if(digitalRead(LedPin))
{
Serial1.println("On");
} else {
Serial1.println("Off");
}
while(1)
{
if(Serial1.available())
{
Serial1.print("Character "); //print string
Serial1.print(Serial1.read()); //print single input character
Serial1.println("..."); //print string with new line
}
}
}