DECS @UNIST / Mbed 2 deprecated Anybaro_ver_7

Dependencies:   mbed

Revision:
12:75fb40f38c19
Parent:
11:5f05b14649ee
Child:
13:5601fedf0e12
--- a/main.cpp	Tue Jul 02 21:34:50 2019 +0000
+++ b/main.cpp	Tue Jul 02 21:57:47 2019 +0000
@@ -3,7 +3,8 @@
 #include "ForceRead.h"
 
 Serial              bt(PA_9,PA_10);              // USART1 Bluetooth (Tx, Rx)
-Serial              pc(PA_2,PA_3);               // USART2 pc (Tx, Rx)
+//Serial              pc(PA_2,PA_3);               // USART2 pc (Tx, Rx)
+Serial              pc(USBTX,USBRX);               // USART2 pc (Tx, Rx)
 
 InterruptIn         up(PC_8);                    // Button Interrupt Motor control
 InterruptIn         down(PC_9);
@@ -196,18 +197,36 @@
         MotorButton();
     }
 }
-
+//---------------------- testing ------------- 190703 BH
+InterruptIn         nFault(PB_15);               // Motor Driver DRV
+void nFaultHigh(){
+    pc.puts("nFault HIGH\r\n");
+    bt.puts("nFault HIGH\r\n");
+}
+void nFaultLow(){
+    pc.puts("nFault LOW\r\n");
+    bt.puts("nFault LOW\r\n");
+}
+//---------------------- end ------------- 190703 BH
 int main()
 {
     bt.baud(115200);
-//    pc.baud(115200);
-    bt.puts("START 190627 Ver.8 \n");
+    pc.baud(115200);
+    bt.puts("START 190703 Ver.8 \r\n");
+    pc.puts("START 190703 Ver.8 \r\n");
     int modeNum = 0;   
     int modeMotor = 0;
 
     char tmpCommand[4]={0,};                                // [ADD] command
     int rxVal;
     
+    //---------------------- testing ------------- 190703 BH
+    nFault.mode(PullUp);
+    nFault.fall(&nFaultLow);
+    nFault.rise(&nFaultHigh);
+    
+    //---------------------- end ------------- 190703 BH    
+    
     up.mode(PullNone);
     down.mode(PullNone);
     bt_ml.mode(PullNone);                                   // [ADD] Setup Millking Action Manual Button