florian schriebl / bertl14

Fork of bertl14 by Kevin Heinrich

Files at this revision

API Documentation at this revision

Comitter:
heinrich_kevin
Date:
Mon Feb 01 10:48:40 2016 +0000
Parent:
2:d9f2452ba88d
Child:
4:5162af5a63d4
Child:
5:066936e2c097
Commit message:
Test;

Changed in this revision

bertl14.cpp Show annotated file Show diff for this revision Revisions of this file
bertl14.h Show annotated file Show diff for this revision Revisions of this file
--- a/bertl14.cpp	Sun Jan 31 16:44:34 2016 +0000
+++ b/bertl14.cpp	Mon Feb 01 10:48:40 2016 +0000
@@ -2,12 +2,12 @@
 #include "bertl14.h"
 //*********************************************************************************
 // Define Motor Routines
-DigitalOut engineLR(P1_0);     //IN1, EP10, MG1A => MG1 engine-Pin 2, left_Reverse
-DigitalOut engineLF(P1_1);     //IN2, EP11, MG1B => MG1 engine-Pin 1, left_Forward
-PwmOut engineLEN(p34);       //EN1, P34, left_ENABLE
-DigitalOut engineRR(P1_4);    //IN4, EP13, MG2A => MG2 engine-Pin 2, right_Reverse
-DigitalOut engineRF(P1_3);    //IN3, EP14, MG2B => MG2 engine-Pin 1, right_Forward
-PwmOut engineREN(p36);      //EN2, P36, right_ENABLE
+DigitalOut engineLR(P1_0);      //IN1, EP10, MG1A => MG1 engine-Pin 2, left_Reverse
+DigitalOut engineLF(P1_1);      //IN2, EP11, MG1B => MG1 engine-Pin 1, left_Forward
+PwmOut engineLEN(p34);          //EN1, P34, left_ENABLE
+DigitalOut engineRR(P1_4);      //IN4, EP13, MG2A => MG2 engine-Pin 2, right_Reverse
+DigitalOut engineRF(P1_3);      //IN3, EP14, MG2B => MG2 engine-Pin 1, right_Forward
+PwmOut engineREN(p36);          //EN2, P36, right_ENABLE
 //**********************************************************************************
 // Define PC9555 Routines
 I2C pc9555(P0_5, P0_4);// SDA, SCL
@@ -28,7 +28,6 @@
     data[0] = PC9555_PORT1_DIRCONFIG;
     data[1] = 0xFF;
     pc9555.write(PC9555_ADDR_W, data, 2);
-  
 }
 
 void bertl_PC9555_leds(unsigned char leds)
@@ -58,9 +57,6 @@
 }
 // END PC9555 Routines
 //**********************************************************************************
-
-
-
 //**********************************************************************************
 // Begin Motor Routines
 void bertl_engine(int left, int right)
--- a/bertl14.h	Sun Jan 31 16:44:34 2016 +0000
+++ b/bertl14.h	Mon Feb 01 10:48:40 2016 +0000
@@ -1,6 +1,6 @@
 #include <mbed.h>
 //LED-Defines
-#define LED_OFF 0x00            // All Leds are off
+#define LED_OFF 0x00            // 0b0000 0000, All Leds are off
 #define LED_FL_WHITE 0x01       // 0b0000 0001, BERTL FORWARD Left-Side WHITE-LED
 #define LED_FL_YELLOW 0x02      // 0b0000 0010, BERTL FORWARD Left-Side YELLOW-LED
 #define LED_FR_WHITE 0x04       // 0b0000 0100, BERTL FORWARD Right-Side WHITE-LED
@@ -9,14 +9,14 @@
 #define LED_BL_YELLOW 0x20      // 0b0010 0000, BERTL BACKWARD Left-Side YELLOW-LED
 #define LED_BR_RED 0x40         // 0b0100 0000, BERTL BACKWARD Right-Side RED-LED
 #define LED_BR_YELLOW 0x80      // 0b1000 0000, BERTL BACKWARD Right-Side YELLOW-LED
-#define LED_ON 0xFF             // All Leds are on
+#define LED_ON 0xFF             // 0b1111 1111, All Leds are on
 
-#define LED_R_YELLOW (LED_FR_YELLOW|LED_BR_YELLOW)          //Right Side, YELLOW-LEDs are on
-#define LED_L_YELLOW (LED_FL_YELLOW|LED_BL_YELLOW)          //Left Side, YELLOW-LEDs are on
-#define LED_F_WHITE (LED_FL_WHITE|LED_FR_WHITE)             //Forward, WHITE-LEDs are on
-#define LED_B_RED (LED_BL_RED|LED_BR_RED)                   //Backward, RED LEDs are on
-#define LED_B_ALL (LED_B_RED|LED_BL_YELLOW|LED_BR_YELLOW)   //Backward, All LEDs are on
-#define LED_F_ALL (LED_F_WHITE|LED_FL_YELLOW|LED_FR_YELLOW) //Forward, All LEDs are on
+#define LED_R_YELLOW (LED_FR_YELLOW|LED_BR_YELLOW)          // 0b1000 1000, BERTL Right Side, YELLOW-LEDs are on
+#define LED_L_YELLOW (LED_FL_YELLOW|LED_BL_YELLOW)          // 0b0010 0010, BERTL Left Side, YELLOW-LEDs are on
+#define LED_F_WHITE (LED_FL_WHITE|LED_FR_WHITE)             // 0b0000 0101, BERTL Forward, WHITE-LEDs are on
+#define LED_B_RED (LED_BL_RED|LED_BR_RED)                   // 0b0101 0000, BERTL Backward, RED LEDs are on
+#define LED_B_ALL (LED_B_RED|LED_BL_YELLOW|LED_BR_YELLOW)   // 0b1111 0000, BERTL Backward, All LEDs are on
+#define LED_F_ALL (LED_F_WHITE|LED_FL_YELLOW|LED_FR_YELLOW) // 0b0000 1111, BERTL Forward, All LEDs are on
 //--------------------------------------
 // Switches:
 // Switch TA1: DEZ = 1