diff --git a/bin/log/logging.md b/bin/log/logging.md deleted file mode 100644 index e69de29..0000000 diff --git a/bin/micro_bit/micro_bit_soft/decoder/encoder.py b/bin/micro_bit/micro_bit_soft/decoder/encoder.py index 507cac9..373d8da 100644 --- a/bin/micro_bit/micro_bit_soft/decoder/encoder.py +++ b/bin/micro_bit/micro_bit_soft/decoder/encoder.py @@ -1,4 +1,6 @@ # create class that encodes plain text into morse +import microbit + class Encoder: # init class @@ -24,6 +26,7 @@ class Encoder: self.__input_raw = "" self.__output = [] self.__pos = 0 + self.check = 0 def encode(self): self.__input_raw = self.get_input() @@ -33,4 +36,20 @@ class Encoder: return self.__output def get_input(self): - return input("please input some text here to transmit: ").upper() + self.str_input = "Please type the text to be morsed. " + microbit.uart.write(self.str_input.encode()) + self.input = "" + while self.input == "": + self.input = microbit.uart.read(1) + + self.ouput = "" + self.check = 0 + + while self.check < 3: + self.input = microbit.uart.read(1) + if self.input == "": + self.output += self.input + self.check += 1 + else: + self.ouput += self.input + return self.ouput diff --git a/bin/micro_bit/micro_bit_soft/micro_bit_soft.py b/bin/micro_bit/micro_bit_soft/micro_bit_soft.py index afa3941..0724caa 100644 --- a/bin/micro_bit/micro_bit_soft/micro_bit_soft.py +++ b/bin/micro_bit/micro_bit_soft/micro_bit_soft.py @@ -1,2 +1,3 @@ import microbit +microbit.uart.write() \ No newline at end of file diff --git a/log/logging.md b/log/logging.md new file mode 100644 index 0000000..4569340 --- /dev/null +++ b/log/logging.md @@ -0,0 +1,4 @@ +# LOGGING in this Program. + +The log files that are created during the execution of this program are **__NOT__** shared with anybody automatically. +If you wish to do a bugreport, we encourage you to include the log of the program. You can obviously take a look at the log file before sending it. \ No newline at end of file