## 3 Realization of Proposed QCD-OCC System
### Implementation of Proposed QCD-OCC System Prototype  
The proposed QCD-OCC system prototype consists of a programmable board (Arduino Uno)-controlled 8 \(\times\) 8 neopixel LED matrix (Adafruit WS2812B) as Tx, and a computer with an attached webcam (Logitech C310) as the Rx. This circuit diagram and implemented Tx are shown in Figure 8a,b. Pins v+, v-, and in of the LED matrix were connected to the 5v, ground(GND), and digital pin 6 of the Arduino board in the same order. Pin 6 was set to output using the \(pinMode(6,OUTPUT)\) command. Algorithm 1 shows the steps involved in transmitting data using the QCD-OCC Tx. Three predefined message strings were used as input, namely, \(F1\), \(F2\) and \(F3\). \(M\) is the maximal length of these three strings, computed using \(length\) and \(max\) functions. \(N_{frames}\) is the number of frames required to transmit overall data. \(frame\); is initialized to 0 and used to track the current frame number. \(Adafruit\_Neopixel\) is a class of the Adafruit library that provides access to functions used for controlling neopixel LEDs. \(pix\) is an object of the \(Adafruit\_Neopixel\) class, and the constructor accepted the number of LEDs (64), connected pin number (6), and the type of the neopixel LEDs (\(NEO\_GRB+NEO\_KHz800\) ) as its parameters. \(delayVal\) is the delay between successive Tx frames. Thus, if \(Tx_{frames}\) are 5 per second, then \(delayVal\) is 200 ms. The \(Loop\) (10) function sets the anchor pattern (1), top 2 \(\times\) 4 data pattern (1), bottom 2 \(\times\) 4 data pattern (1), and middle 4 \(\times\) 8 data pattern (1) of the Tx frame as per the input characters. Figure 8: Implementation of proposed Tx. (**a**) Circuit diagram; (**b**) connected hardware components. Figure 7: Tx and Rx simulator screenshots of proposed QCD–OCC system. ```
1:Initialize strings \(F1\), \(F2\) and \(F3\)
2:\(M=max(F1.length(),max(F2.length(),F3.length()))\)
3:\(N_{frames}=ceil((m\times 8)\div 48)\)
4:\(frame_{i}=0\)
5:\(Adafruit\_NeoPixelpix=Adafruit\_NeoPixel(64,6,type)\)
6:\(delayVal=1000/Tx_{f}rames\)
7:functionSetup
8: Set pin mode to output for pin 6
9:endfunction
10:functionLoop
11: SetAnchorPattern()
12: SetTopDataPattern(\(frame_{i}\))
13: SetBottomDataPattern(\(frame_{i}\))
14: SetMidDataPattern(\(frame_{i}\))
15: pix.show()
16: delay(\(delayVal\))
17:\(frame_{i}++\)
18:ifmod\((frame_{i},N_{f}rames)=0\)then
19:\(frame_{i}=0\)
20:endif
21:endfunction
```  
**Algorithm 2** Supporting Functions: SetAnchorPattern. Algorithms 2-5 show the implementation of the supporting functions. The \(SetAnchorPattern\) function sets the pattern for the four corner 2 \(\times\) 2 positions as zero or unity matrices per the Tx frame format. Each Tx frame represents 6 bytes per channel. The \(bitRead\) function is used to read the bit value of a byte at the specific input index. ```
functionSetAnchorPattern \(A_{1}(2,2)=0\), \(A_{2}(2,2)=1\), \(A_{3}(2,2)=1\), \(A_{4}(2,2)=1\) endfunction
```  
**Algorithm 3** Supporting functions: SetTopDataPattern. ```
functionSetTopDataPattern(\(frame_{i}\)) \(charF1c1=F1.charAt(6\times frame_{i})\) \(charF2c1=F2.charAt(6\times frame_{i})\) \(charF3c1=F3.charAt(6\times frame_{i})\) for(\(i=2;i<6;i++\)) do \(T_{D}(0,i)=pix.setPixelColor(i,pixels.Color(255*bitRead(F1c1,7-(i-2)),255*bitRead( F2c1,7-(i-2)),255*bitRead(F3c1,7-(i-2))))\) endforfor(\(i=10;i<14;i++\)) do \(T_{D}(1,i-8)=pix.setPixelColor(i,pix.Color(255*bitRead(F1c1,3-(i-10)),255*bitRead( F2c1,3-(i-10))),255*bitRead(F2c1,3-(i-10))))\) endfor endfunction
```  
**Algorithm 4** Supporting functions: SetTopDataPattern.