|
|
@ -22,10 +22,12 @@ int main(int argc, char *argv[])
|
|
|
|
NO_PARITY_CTRL,
|
|
|
|
NO_PARITY_CTRL,
|
|
|
|
noFlowControl);
|
|
|
|
noFlowControl);
|
|
|
|
|
|
|
|
|
|
|
|
// print_Usart(usart2, ASCII_clear);
|
|
|
|
//clears screen and send the wellcome messgae
|
|
|
|
|
|
|
|
print_Usart(usart2, ASCII_clear);
|
|
|
|
print_Usart(usart2, const_cast<char *>("Wellcome to our KED project\n\r"));
|
|
|
|
print_Usart(usart2, const_cast<char *>("Wellcome to our KED project\n\r"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//blinks 10 times to indicate the sicsessfull init if the device
|
|
|
|
for(i = 0 ; i < 10 ; i++)
|
|
|
|
for(i = 0 ; i < 10 ; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
delayMs(100);
|
|
|
|
delayMs(100);
|
|
|
@ -35,12 +37,11 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
|
|
|
|
|
|
pinWrite(pinB3,0);
|
|
|
|
pinWrite(pinB3,0);
|
|
|
|
|
|
|
|
|
|
|
|
//usartSendChar(usart2, a);
|
|
|
|
|
|
|
|
while(1)
|
|
|
|
while(1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
//USART will rteturn what wou type and trun led on if you press "1"
|
|
|
|
a = usartGetChar(usart2);
|
|
|
|
a = usartGetChar(usart2);
|
|
|
|
usartSendChar(usart2, a);
|
|
|
|
usartSendChar(usart2, a);
|
|
|
|
|
|
|
|
|
|
|
|
if(a == '1')
|
|
|
|
if(a == '1')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pinWrite(pinB3,1);
|
|
|
|
pinWrite(pinB3,1);
|
|
|
@ -50,7 +51,7 @@ int main(int argc, char *argv[])
|
|
|
|
pinWrite(pinB3,0);
|
|
|
|
pinWrite(pinB3,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
//test if the gpio port works as an input
|
|
|
|
if(pinRead(pinA0))
|
|
|
|
if(pinRead(pinA0))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pinWrite(pinB3,1);
|
|
|
|
pinWrite(pinB3,1);
|
|
|
@ -59,7 +60,6 @@ int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pinWrite(pinB3,0);
|
|
|
|
pinWrite(pinB3,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
delayMs(100);
|
|
|
|
delayMs(100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|