ECE3872 HW/SW Project Code

Dependencies:   mbed Servo mbed-rtos 4DGL-uLCD-SE PinDetect X_NUCLEO_53L0A1

Revision:
18:0e0edd4f9e4d
Parent:
16:62976c3c029e
Child:
25:7764baddb7bc
--- a/motor_ctl.h	Mon Apr 13 02:23:16 2020 +0000
+++ b/motor_ctl.h	Mon Apr 13 02:43:08 2020 +0000
@@ -2,7 +2,7 @@
 
 #include "mbed.h"
 #include "Servo.h"
-//#include "rtos.h"
+#include "rtos.h"
 
 Servo r_arm(p24);
 Servo l_arm(p23);
@@ -21,15 +21,15 @@
 //and then the distance can just control the height
 //movement pattern can be random.. right now every other note recorded will be distributed to one side and the rest will go to the other
 
-unsigned char move_map {0x149, 0x14A, 0x14C, 0x151, 0x152, 0x154, 0x291, 0x292, 0x294, 0x2A1, 0x2A2, 0x2A4};
-unsigned char ra_mask = 0x0C0;
-unsigned char la_mask = 0x300;
-unsigned char rl_mask = 0x03C;
-unsigned char ll_mask = 0x007; 
+unsigned short move_map[] {0x149, 0x14A, 0x14C, 0x151, 0x152, 0x154, 0x291, 0x292, 0x294, 0x2A1, 0x2A2, 0x2A4};
+unsigned short ra_mask = 0x0C0;
+unsigned short la_mask = 0x300;
+unsigned short rl_mask = 0x03C;
+unsigned short ll_mask = 0x007; 
 
 //for testing run through move map
 
-void ra_dance(unsigned char move) {    
+void ra_dance(unsigned short move) {    
     if (move & ra_mask == 0x040){
         r_arm.write(.50);
     } else {
@@ -38,7 +38,7 @@
     
 }
 
-void la_dance() {    
+void la_dance(unsigned short move) {    
      if (move & ra_mask == 0x100){
         l_arm.write(.50);
     } else {