share my UART receive code

global_list.py:

buf = bytearray(30)

main.py:

import global_list
import sensor
import time, sensor, pyb
from pyb import UART
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.VGA)
sensor.skip_frames()
uart = UART(3, 9600)
led = pyb.LED(3)
clock = time.clock()
while(True):
    clock.tick()
    img = sensor.snapshot()
    print(clock.fps())
    if (uart.any()):
        uart.readinto(global_list.buf)
        print(global_list.buf)
        if global_list.buf[0] == 0xAA:
            led.on()
        if global_list.buf[1] == 0xAB:
            led.off()