Callum and Adel's changes on 12/02/19

Dependencies:   Crypto

Revision:
21:b296db05483d
Parent:
20:c60f4785b556
Child:
22:efa60ca0bfb7
--- a/main.cpp	Thu Mar 14 23:28:20 2019 +0000
+++ b/main.cpp	Sat Mar 16 12:29:43 2019 +0000
@@ -71,7 +71,7 @@
 DigitalOut L3L(L3Lpin);
 DigitalOut L3H(L3Hpin);
 
-
+PwmOut pwmCtrl(PWMpin);
 /*//Declare and start threads
 class T_{
     
@@ -464,6 +464,12 @@
     uint32_t hashCounter = 0;
     Timer timer;   
     
+    float dutyC = 1; // 100%
+    float mtrPeriod = 2e-3; // motor period
+
+    pwmCtrl.period(mtrPeriod);
+    pwmCtrl.pulsewidth(mtrPeriod*dutyC);
+
     comm_plz.start_comm();
 
     // Motor States
@@ -501,6 +507,9 @@
    //     intStateOld = intState;
    //     motorOut((intState-orState+lead+6)%6); //+6 to make sure the remainder is positive
    // }
+   
+    dutyC = 0.8;
+    pwmCtrl.pulsewidth(mtrPeriod*dutyC);
 
 
     // Keep the program running indefinitely