LAB10 tamplate for Oppgave2

Dependencies:   mbed

Fork of LAB10_Oppgave1 by EN-SOC3001

Import program

00001 #include "mbed.h"
00002 
00003 Serial pc(USBTX, USBRX);
00004 
00005 // The pc has sendt a char to us
00006 void pcTxSrialData()
00007 {   char rxData=pc.getc();
00008     pc.putc(rxData);
00009 }
00010 
00011 int main()
00012 {
00013     //Listen for serial data from the PC
00014     pc.attach(&pcTxSrialData);
00015 
00016     while (1) {
00017         wait(1);
00018     }
00019 }
00020 
00021 
00022 

main.cpp

Committer:
rlanghbv
Date:
2015-11-04
Revision:
2:dc9d556924d9
Parent:
1:c3e8496642b4

File content as of revision 2:dc9d556924d9:

#include "mbed.h"

Serial pc(USBTX, USBRX);

// The pc has sendt a char to us
void pcTxSrialData()
{   char rxData=pc.getc();
    pc.putc(rxData);
}

int main()
{
    //Listen for serial data from the PC
    pc.attach(&pcTxSrialData);

    while (1) {
        wait(1);
    }
}