USB programming

前端 未结 10 1909
不思量自难忘°
不思量自难忘° 2021-01-30 11:19

I want to program a microcontroller (AVR) to control some leds through USB. It\'s just out of interest in how to build and program USB devices. There are some AVR microcontrolle

10条回答
  •  悲&欢浪女
    2021-01-30 11:58

    You could us libusb. It's powerful and cross-platform.

    But what you're trying to do is a rather simple control interface. You can sidestep most of the complexity by using HIDAPI, I think.

    http://www.signal11.us/oss/hidapi/

    HID devices often use generic drivers that come packaged into the OS. That way you don't actually have to write any drivers ever, you just make your device compliant with the generic driver and tailor the client software to it.

    I think this is what's usually done in the hobbyist electronics field, which is what you're interested in here.

    HIDAPI is even recommended for simple communications with HID devices in the libusb FAQ since its a bit more complicated to do it across platforms using libusb.

提交回复
热议问题