stephen reidy / Mbed 2 deprecated Q11MTU_COMP71004_a

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
stephensv650
Date:
Tue May 18 15:33:15 2021 +0000
Parent:
0:1ab76f8f48ce
Commit message:
Q11 Complete

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 1ab76f8f48ce -r b0727a3df2eb main.cpp
--- a/main.cpp	Sun May 09 13:29:46 2021 +0000
+++ b/main.cpp	Tue May 18 15:33:15 2021 +0000
@@ -1,40 +1,40 @@
 /*
 part of the MTU COMP71004 module
 author: Krishna Panduru
-
+ 
 the program here performs a serial passthrough operation between USB and serial (p9, p10). 
 correct upto 5 errors for proper functionality. 
 the 6th error is a runtime error generating the following error. correct that as well.
-
+ 
 ++ MbedOS Error Info ++ 
 Error Status: 0x80010130 Code: 304 Module: 1 
 Error Message: pinmap not found for peripheral 
 Location: 0x4353 Error Value: 0xFFFFFFFF
 */
 #include "mbed.h"
-
-
+ 
+ 
 DigitalOut myled(LED1);
-Serial pc(USBRX, USBTX);
+Serial pc(USBTX, USBRX);
 Serial dev(p9, p10);
-
+ 
 void dev_recv(){
     while(dev.readable()){
-        pc.putc(dev.getc())    
+        pc.putc(dev.getc());    
     }    
 }
-
+ 
 void pc_recv(){
     while(pc.readable()){
         dev.putc(pc.getc());    
     }    
 }
-
+ 
 int main() {
     pc.baud(9600);
-    device1.baud(115200);
+    dev.baud(115200);
     pc.attach(&pc_recv);
-    dev.atach(&dev);
+    dev.attach(&dev_recv);
     pc.printf("Hello!! \r\n");
     
     while(1) {
@@ -44,3 +44,4 @@
         wait(1);
     }
 }
+