import machine
from utime import sleep
import usb_hid
# from time import sleep
# import time
from machine import Pin
from pyb import LED
from ir_rx.nec import NEC_8 # NEC remote, 8 bit addresses
# # COMMANDS = {
# # "UP": 0xE0 0x18,
# # "DOWN": 0xE0 0x1C,
# # "LEFT": 0xE0 0x1A,
# # "RIGHT": 0xE0 0x1B,
# # "HOME": 0xE0 0x30,
# # "BACK": 0xE0 0x1D,
# # "OK": 0xE0 0x0C,
# # "PLAY": 0xE0 0x24,
# # "PAUSE": 0xE0 0x23,
# # "STOP": 0xE0 0x25,
# # "APPS": 0xE0 0x08,
# # }
# red = LED(1)
sleep(0.01) # Wait for USB to connect
print("Hello, Pi Pico!")
# def callback(data, addr, ctrl):
# if data < 0: # NEC protocol sends repeat codes.
# print('Repeat code.')
# else:
# print('Data {:02x} Addr {:04x}'.format(data, addr))
# ir = NEC_8(Pin(16, Pin.IN), callback)
# print('booting...')
# while True:
# time.sleep_ms(500)
# red.toggle()