| Algorithm 9. Data Transmission Success Rate for Transmission: |
| DTSR Algorithm (Transmission Side) : Assesses the transmission success rate, measuring the accuracy and reliability of the LCS in real-time data transfer scenarios. |
| Input: User choice for starting |
| Output: Transmit laser signals |
| 1: define transmitNumber(number) function |
| 2: convert number to char and store in variable c |
| 3: transmit c using transmitChar function |
| 4: transmit newline character using transmitChar function to signal end of a number |
| 5: end function |
| 6: define transmitChar(c) function |
| 7: set ledPin to HIGH (start bit) |
| 8: delay for transmitDuration microseconds |
| 9: set ledPin to LOW |
| 10: for i = 0 to 7 do (for each bit in the character) |
| 11: set ledPin to the ith bit of c |
| 12: delay for transmitDuration microseconds |
| 13: end for |