University of Texas Solar Vehicles Team / Mbed 2 deprecated motor-control

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
armin1376
Date:
Thu Nov 14 00:31:13 2019 +0000
Parent:
6:e7c29e46ad6c
Commit message:
Shows speed and current values but not temp

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Nov 13 23:34:18 2019 +0000
+++ b/main.cpp	Thu Nov 14 00:31:13 2019 +0000
@@ -78,6 +78,7 @@
 
 
     while(1){
+        
            if(can2.read(msg) && msg.id == (MC_BASE+MC_VEL)) {
         for (int i = 0; i < msg.len; i++) {
           rdata2[i] = msg.data[i];
@@ -115,6 +116,7 @@
 
     can1.frequency(125000);  
     Thread V1(speeed);
+
     
   float current = MAX_CURRENT;
   float velocity = MAX_VELOCITY;
@@ -333,7 +335,7 @@
         if (!can1.write(CANMessage(0x242, (char*) rdata, 8))) {
           pc.printf("Cannot write to CAN\n");
         }
-//        wait(0.001);
+        wait(0.1);
  
         urxdata.rcvdata[3] = rdata[7];
         urxdata.rcvdata[2] = rdata[6];
@@ -457,7 +459,7 @@
         if (!can1.write(CANMessage(0x24B, (char*) rdata7, 8))) {
           pc.printf("Cannot write to CAN\n");
         }
-//        wait(0.001);
+        wait(0.1);
  
         urxdata.rcvdata[3] = rdata7[7];
         urxdata.rcvdata[2] = rdata7[6];