CECS 447 Team Pair (Loc/Ivan) / Mbed 2 deprecated project2_uart

Dependencies:   mbed

main.cpp

Committer:
kinetik
Date:
2015-09-28
Revision:
0:3467a96a77d0

File content as of revision 0:3467a96a77d0:

#include "mbed.h"
Serial pc(USBTX, USBRX); // tx, rx
int main()
{
    char in_bound;
    pc.baud(19200);
    pc.printf("Welcome to the Diamond Dogs intercom!\n\r What would you like to transmit to Venom Snake?/n/r");
    while(1) {
        pc.printf("(:D) ");
        
        in_bound = pc.getc();
        if(in_bound == '\r')
        {
            pc.printf("\n\r");   
        }
        else if (in_bound == '*')
        {
            pc.printf("Loc and Ivan's hometown: Garden Grove");   
        }
        else 
            pc.putc(in_bound);
        
                    
    }    
 }