<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/8485" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2013-06-11T01:15:42+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/8485</id>

		<entry>
		<author><name><![CDATA[MikeG]]></name></author>
		<updated>2013-06-11T01:15:42+02:00</updated>

		<published>2013-06-11T01:15:42+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8485&amp;p=25401#p25401</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8485&amp;p=25401#p25401"/>
		<title type="html"><![CDATA[V-USB+Arduino+Consumer Devices+Me &lt;&gt; Work]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8485&amp;p=25401#p25401"><![CDATA[
Help (please).<br /><br />I'm trying to implement a dedicated multimedia controller (Play/Pause, Vol +/- Next/previous track) on Windows7 with little success.<br />I started with the Arduino Keyboard sketch (<a href="http://blog.petrockblock.com/2012/05/19/usb-keyboard-with-arduino-and-v-usb-library-an-example/" class="postlink">http://blog.petrockblock.com/2012/05/19/usb-keyboard-with-arduino-and-v-usb-library-an-example/</a> with vusb-for-arduino-005.zip. Got that to work (1/2W Zener Diodes NOT 1W, libusb).<br /><br />Then changed the report descriptor to a consumer device.<br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM char usbHidReportDescriptor&#91;31&#93; = { // USB report descriptor<br />0×05, 0×0c,                    // USAGE_PAGE (Consumer Devices)<br />0×09, 0×06,                    // USAGE (Keyboard)<br />0xa1, 0×01,                    // COLLECTION (Application)<br />0×05, 0x0c,                    //   USAGE_PAGE (Consumer Devices)<br />0×09, 0xcd,                    //   play/pause<br />0×09, 0xe9,                    //   volume up<br />0×09, 0xea,                    //   volume down<br />0×09, 0xb5,                    //   next track<br />0×09, 0xb6,                     // previous track<br />0×09, 0xec,                      // mute<br />0×15, 0×00,                    //   LOGICAL_MINIMUM (0)<br />0×25, 0×01,                    //   LOGICAL_MAXIMUM (1)<br />0×95, 0×06,                    //   REPORT_COUNT (6)<br />0×75, 0×01,                    //   REPORT_SIZE (1)<br />0×81, 0×02,                    // INPUT (Data,Var,Abs)<br />0xc0<br />};<br /></code></pre></div><br /><br />Changed the VID/PID, reset libusb... <br />Changed code in USBKeyboard.h<br /><div class="codebox"><p>Code: </p><pre><code>void sendKeyStroke(byte keyStroke, byte modifiers) {<br />      <br />    while (!usbInterruptIsReady()) {<br />      // Note: We wait until we can send keystroke<br />      //       so we know the previous keystroke was<br />      //       sent.<br />    }<br />      <br />    memset(reportBuffer, 0, sizeof(reportBuffer));<br /><br /><br />    reportBuffer&#91;0&#93; = keyStroke;</code></pre></div><br /><br />Windows reports a USB Inout Device (with proper VID/PID). Sending 1 or 2 as a keystroke should Play/Pause and Vol. +.<br />Nothing happens.<br /><br />Any assistance Sensi's.<br />I am but a grasshopper.<br /><br />     Mike G.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=19764">MikeG</a> — Tue Jun 11, 2013 1:15 am</p><hr />
]]></content>
	</entry>
	</feed>
