4180 Morse / Mbed 2 deprecated morseCode_1_1

Dependencies:   mbed 4DGL-uLCD-SE

Fork of morseCode_1 by 4180 Morse

Revision:
5:5b86521e418c
Parent:
4:62c590826ddb
Child:
6:421ece74143e
--- a/Header_file.h	Sat Apr 28 16:04:28 2018 +0000
+++ b/Header_file.h	Sun Apr 29 01:04:11 2018 +0000
@@ -317,4 +317,46 @@
         dot();
     }
     else{wait(1);}//error character, or space character.
-}
\ No newline at end of file
+}
+
+
+class Tree {
+public:
+    char value;
+    Tree *dot;
+    Tree *dash;
+
+    Tree(){}
+
+    Tree createRoot();
+    void insertdot(char newValue, Tree *rootNode);
+    void insertdash(char newValue, Tree *rootNode);
+    char returnvalue(Tree *rootNode);
+    //void deleteNode(Tree *deleteNode);  //Didn't see the need for a delete function since the tree is pretty static
+};
+
+//Inserting an item on the "dot" side of a node
+//Adds the value, and pointers go to NULL
+void Tree::insertdot(char newValue, Tree *rootNode){
+    rootNode->dot = new Tree;
+    rootNode->dot->value = newValue;
+    rootNode->dot->dot = NULL;
+    rootNode->dot->dash = NULL;
+    return;
+}
+
+//Inserting an item on the "dash" side of a node
+void Tree::insertdash(char newValue, Tree *rootNode){
+    rootNode->dash = new Tree;
+    rootNode->dash->value = newValue;
+    rootNode->dash->dot = NULL;
+    rootNode->dash->dash = NULL;
+    return;
+}
+
+char returnvalue(Tree *rootNode){
+    return rootNode->value;
+}
+
+
+