Text_to_morse function written

Dependencies:   mbed 4DGL-uLCD-SE

Fork of morseCode_1 by 4180 Morse

Committer:
colson
Date:
Sat Apr 28 16:04:28 2018 +0000
Revision:
4:62c590826ddb
Parent:
3:6e52b66c5a0c
Child:
5:5b86521e418c
-Fixed the text_to_morse function ; -Created debug outputs (LED and uLCD); -Tested ability to take input string

Who changed what in which revision?

UserRevisionLine numberNew contents of line
colson 0:4e10b6c94be9 1 #include "mbed.h"
colson 4:62c590826ddb 2 #include "Header_file.h"
colson 4:62c590826ddb 3 #include <iostream>
colson 4:62c590826ddb 4 #include <string>
colson 4:62c590826ddb 5
colson 0:4e10b6c94be9 6
Jeco13 3:6e52b66c5a0c 7 //Part 1
Jeco13 3:6e52b66c5a0c 8 //Main takes in string text input from bluetooth module. Store in string variable
Jeco13 3:6e52b66c5a0c 9 //call text_to_morse function on each character from input string variable
Jeco13 3:6e52b66c5a0c 10
colson 0:4e10b6c94be9 11 int main() {
colson 4:62c590826ddb 12
colson 4:62c590826ddb 13 string newString = "YYZ";
colson 4:62c590826ddb 14
colson 4:62c590826ddb 15 for (int i = 0; i < newString.length(); i++){
colson 4:62c590826ddb 16 Text_to_morse(newString[i]);
colson 4:62c590826ddb 17 }
colson 4:62c590826ddb 18
colson 4:62c590826ddb 19 char schar = 's';
colson 4:62c590826ddb 20 char ochar = 'o';
colson 0:4e10b6c94be9 21 while(1) {
colson 4:62c590826ddb 22 uLCD.printf("do this\n");
colson 4:62c590826ddb 23 Text_to_morse(schar);
colson 4:62c590826ddb 24 Text_to_morse(ochar);
colson 4:62c590826ddb 25 Text_to_morse(schar);
colson 4:62c590826ddb 26 wait(0.5);
colson 0:4e10b6c94be9 27 }
colson 0:4e10b6c94be9 28 }