pyb.usb_mode('CDC+HID', pyb.hid_keyboard) in boot.py
error
TypeError: extra positional arguments given
ver of firmware:
Micro Python v1.4.2-25-g9472907 on 2015-04-28; PYBv1.0 with STM32F405RG
HID Keyboard functionality?
Re: HID Keyboard functionality?
I think you need to use:
(i.e. add the hid=)
Code: Select all
pyb.usb_mode('CDC+HID', hid=pyb.hid_keyboard)
Re: HID Keyboard functionality?
This works awesome. However, I cant work out how to do a capital letter. This is what I tried.
id think this would give me a "A" but it gives an "a"
Code: Select all
buf = bytearray(8) # report is 8 bytes long
buf[2] = 0xE1
hid.send(buf) # key pressed
pyb.delay(10)
buf[2] = 0x04
hid.send(buf) # key pressed
pyb.delay(10) # wait until report sent; can also use: select.select([], [hid], [])
buf[2] = 0
hid.send(buf) # key released
pyb.delay(10)
Re: HID Keyboard functionality?
My apologies in advance for resurrecting an older thread.
Is it possible to bind the micropython board as an HID which is both a keyboard and a mouse at the same time?
Rather than
pyb.usb_mode('CDC+HID')
or
pyb.usb_mode('CDC+HID', hid=pyb.hid_keyboard)
something like
pyb.usb_mode('CDC+HID', hid=pyb.hid_keyboard_mouse)
Is it possible to bind the micropython board as an HID which is both a keyboard and a mouse at the same time?
Rather than
pyb.usb_mode('CDC+HID')
or
pyb.usb_mode('CDC+HID', hid=pyb.hid_keyboard)
something like
pyb.usb_mode('CDC+HID', hid=pyb.hid_keyboard_mouse)