And the code is:

```
# OpenMV 10x10 data matrix decoder
# Added the Infrared LED'S to the project
# Removed the IR blocker on the camera lens, it can now read matrix codes in the dark
# Pi 3.14159265359
import sensor, image, time, math, pyb
from pyb import LED
red_led = LED(1)
green_led = LED(2)
blue_led = LED(3)
ir_led = LED(4)
def led_control(x):
# if (x&8)==8: ir_led.on()
if (x&1)==1: red_led.on()
# if (x&2)==2: green_led.on()
# if (x&4)==4: blue_led.on()
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE) # GrayScale runs faster
#sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQQQVGA)
sensor.skip_frames(time = 2000)
sensor.set_auto_gain(False) # must turn this off to prevent image washout...
sensor.set_auto_whitebal(False) # must turn this off to prevent image washout...
clock = time.clock()
while(True):
clock.tick()
img = sensor.snapshot()
img.lens_corr(1.8) # strength of 1.8 is good for the 2.8mm lens.
for i in range(16):
led_control(i)
matrices = img.find_datamatrices()
for matrix in matrices:
img.draw_rectangle(matrix.rect(), color = (255, 0, 0))
# print_args = (matrix.rows(), matrix.columns(), matrix.payload(), (180 * matrix.rotation()) / math.pi, clock.fps())
# print("Matrix [%d:%d], Payload \"%s\", rotation %f (degrees), FPS %f" % print_args)
# print("N"+ matrix.payload()+"X"+ str(matrix.x())+"Y"+ str(matrix.y())+"R"+ str(matrix.rotation()))
Cx = matrix.x() + (matrix.w()/2) # get the center of the matrix "X" value
Cy = matrix.y() + (matrix.h()/2) # get the center of the matrix "Y" value
Xoff = (img.width()/2) - Cx # Determine how much if any error is present for the X axis
Yoff = (img.height()/2) - Cy # Determine how much if any error is present for the Y axis
print("N"+ str(matrix.payload())+"X"+ str(int(math.ceil(Xoff)))+"Y"+ str(int(math.ceil(Yoff)))+"R"+ str(int(math.ceil((180 * matrix.rotation() / math.pi)))))
```