<?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/8226" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2013-01-23T05:18:47+02:00</updated>

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

		<entry>
		<author><name><![CDATA[imagiro1]]></name></author>
		<updated>2013-01-23T05:18:47+02:00</updated>

		<published>2013-01-23T05:18:47+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24602#p24602</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24602#p24602"/>
		<title type="html"><![CDATA[Re: Can't send double letters?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24602#p24602"><![CDATA[
Thanks Declan. I didn't even think to look at the password generator code. I was using the HID keyboard. I had tried the original code from Frank Zhao's USB business card without success. And now I've figured out why. Linux or Windows running within a VM are not the same thing as Windows. The Linux box can display the text, but does not respond to the CAPS key being pressed. This is why I started from the HID keyboard example and was going to add a button to replace the CAP key functionality. And it simply doesn't work in windows that's being run in VMware. <br /><br />As for adding : and /... _BV(1) is the same as MOD_SHIFT_LEFT<br /><div class="codebox"><p>Code: </p><pre><code>case ':':<br />                    keyboard_report.modifier = _BV(1); // hold shift<br />                    // fall through</code></pre></div><br /><div class="codebox"><p>Code: </p><pre><code>case '/':<br />                    keyboard_report.keycode&#91;0&#93; = 0x38;<br />                    break;</code></pre></div><br /><br />I've also made my own character to replicate Windows key + r.<br /><br /><div class="codebox"><p>Code: </p><pre><code>case '\b':<br />                    keyboard_report.modifier = MOD_GUI_LEFT;<br />                    keyboard_report.keycode&#91;0&#93; = 4+('r' - 'a');<br />                    break;</code></pre></div><br />So when you press the caps key, it launches Window+r and then <!-- m --><a class="postlink" href="http://google.com">http://google.com</a><!-- m -->\n to launch google.com. <br /><br />Thanks again for all the help.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=19457">imagiro1</a> — Wed Jan 23, 2013 5:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[winelight]]></name></author>
		<updated>2013-01-19T13:31:51+02:00</updated>

		<published>2013-01-19T13:31:51+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24578#p24578</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24578#p24578"/>
		<title type="html"><![CDATA[Re: Can't send double letters?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24578#p24578"><![CDATA[
Strangely I did once experience a double letter problem. A dot matrix printer would print a corrupt line if you had a double letter &quot;t&quot; anywhere on it. You had to be careful what you wrote!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=9486">winelight</a> — Sat Jan 19, 2013 1:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[declan smith]]></name></author>
		<updated>2013-01-19T05:01:31+02:00</updated>

		<published>2013-01-19T05:01:31+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24576#p24576</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24576#p24576"/>
		<title type="html"><![CDATA[Re: Can't send double letters?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24576#p24576"><![CDATA[
<blockquote class="uncited"><div>That delay was put in there to see if maybe I was trying to send too quickly. It was not the case. </div></blockquote><br />In USB connection &quot;delay&quot; can be a &quot;case&quot; if it too long.<br />If you want to delay something (especially long delay), I suggest you are using counter in while() loop. It's more save.<br /><br /><br /><blockquote class="uncited"><div>I'm basing my code off code and life's work.</div></blockquote><br />You didn't mention which one, so I tried to use &quot;Password Generator&quot; from code and life's.<br />I disabled &quot;eeprom write and read&quot; lines and change the original string to:<br /><br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM uchar measuring_message&#91;&#93; =&quot;http://google.com cnn.com yahoo.com&quot;;<br /><br />PROGMEM uchar finish_message&#91;&#93; = &quot; New password saved.AAnndd TTrryy TTTToooo TTTyyppeeeee LLLLooooonnngggg TTTTTeeeexxxxtttt&quot;;</code></pre></div><br /><br /><br />Here's the Password Generator code I used from code and life's :<br /><br /><div class="codebox"><p>Code: </p><pre><code>#include &lt;avr/io.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br />#include &lt;avr/wdt.h&gt;<br />#include &lt;avr/eeprom.h&gt;<br /><br />#include &quot;usbdrv.h&quot;<br /><br />//#define F_CPU 12000000L<br />#include &lt;util/delay.h&gt;<br /><br /><br />// *********************************<br />// *** BASIC PROGRAM DEFINITIONS ***<br />// *********************************<br /><br />#define PASS_LENGTH 2 // password length for generated password<br />#define SEND_ENTER 0 // define to 1 if you want to send ENTER after password<br /><br />PROGMEM uchar measuring_message&#91;&#93; = &quot;http://google.com cnn.com yahoo.com&quot;;<br /><br />PROGMEM uchar finish_message&#91;&#93; = &quot; New password saved.AAnndd TTrryy TTTToooo TTTyyppeeeee LLLLooooonnngggg TTTTTeeeexxxxtttt&quot;;<br /><br />// The buffer needs to accommodate the messages above and the password<br />#define MSG_BUFFER_SIZE 200 <br /><br />EEMEM uchar stored_password&#91;MSG_BUFFER_SIZE&#93;;<br /><br /><br />// ************************<br />// *** USB HID ROUTINES ***<br />// ************************<br /><br />// From Frank Zhao's USB Business Card project<br />// http://www.frank-zhao.com/cache/usbbusinesscard_details.php<br />PROGMEM char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; = {<br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x06,                    // USAGE (Keyboard)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x75, 0x01,                    //   REPORT_SIZE (1)<br />    0x95, 0x08,                    //   REPORT_COUNT (8)<br />    0x05, 0x07,                    //   USAGE_PAGE (Keyboard)(Key Codes)<br />    0x19, 0xe0,                    //   USAGE_MINIMUM (Keyboard LeftControl)(224)<br />    0x29, 0xe7,                    //   USAGE_MAXIMUM (Keyboard Right GUI)(231)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)<br />    0x81, 0x02,                    //   INPUT (Data,Var,Abs) ; Modifier byte<br />    0x95, 0x01,                    //   REPORT_COUNT (1)<br />    0x75, 0x08,                    //   REPORT_SIZE (8)<br />    0x81, 0x03,                    //   INPUT (Cnst,Var,Abs) ; Reserved byte<br />    0x95, 0x05,                    //   REPORT_COUNT (5)<br />    0x75, 0x01,                    //   REPORT_SIZE (1)<br />    0x05, 0x08,                    //   USAGE_PAGE (LEDs)<br />    0x19, 0x01,                    //   USAGE_MINIMUM (Num Lock)<br />    0x29, 0x05,                    //   USAGE_MAXIMUM (Kana)<br />    0x91, 0x02,                    //   OUTPUT (Data,Var,Abs) ; LED report<br />    0x95, 0x01,                    //   REPORT_COUNT (1)<br />    0x75, 0x03,                    //   REPORT_SIZE (3)<br />    0x91, 0x03,                    //   OUTPUT (Cnst,Var,Abs) ; LED report padding<br />    0x95, 0x06,                    //   REPORT_COUNT (6)<br />    0x75, 0x08,                    //   REPORT_SIZE (8)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x25, 0x65,                    //   LOGICAL_MAXIMUM (101)<br />    0x05, 0x07,                    //   USAGE_PAGE (Keyboard)(Key Codes)<br />    0x19, 0x00,                    //   USAGE_MINIMUM (Reserved (no event indicated))(0)<br />    0x29, 0x65,                    //   USAGE_MAXIMUM (Keyboard Application)(101)<br />    0x81, 0x00,                    //   INPUT (Data,Ary,Abs)<br />    0xc0                           // END_COLLECTION<br />};<br /><br />typedef struct {<br />   uint8_t modifier;<br />   uint8_t reserved;<br />   uint8_t keycode&#91;6&#93;;<br />} keyboard_report_t;<br /><br />static keyboard_report_t keyboard_report; // sent to PC<br />volatile static uchar LED_state = 0xff; // received from PC<br />static uchar idleRate; // repeat rate for keyboards<br /><br />#define STATE_SEND 1<br />#define STATE_DONE 0<br /><br />static uchar messageState = STATE_DONE;<br />static uchar messageBuffer&#91;MSG_BUFFER_SIZE&#93; = &quot;&quot;;<br />static uchar messagePtr = 0;<br />static uchar messageCharNext = 1;<br /><br /><br />#define MOD_SHIFT_LEFT (1&lt;&lt;1)<br /><br />// The buildReport is called by main loop and it starts transmitting<br />// characters when messageState == STATE_SEND. The message is stored<br />// in messageBuffer and messagePtr tells the next character to send.<br />// Remember to reset messagePtr to 0 after populating the buffer!<br />uchar buildReport() {<br />    uchar ch;<br />    <br />    if(messageState == STATE_DONE || messagePtr &gt;= sizeof(messageBuffer) || messageBuffer&#91;messagePtr&#93; == 0) {<br />        keyboard_report.modifier = 0;<br />        keyboard_report.keycode&#91;0&#93; = 0;<br />        return STATE_DONE;<br />    }<br /><br />    if(messageCharNext) { // send a keypress<br />        ch = messageBuffer&#91;messagePtr++&#93;;<br />        <br />        // convert character to modifier + keycode<br />        if(ch &gt;= '0' &amp;&amp; ch &lt;= '9') {<br />            keyboard_report.modifier = 0;<br />            keyboard_report.keycode&#91;0&#93; = (ch == '0') ? 39 : 30+(ch-'1');<br />        } else if(ch &gt;= 'a' &amp;&amp; ch &lt;= 'z') {<br />            keyboard_report.modifier = (LED_state &amp; 2) ? MOD_SHIFT_LEFT : 0;<br />            keyboard_report.keycode&#91;0&#93; = 4+(ch-'a');<br />        } else if(ch &gt;= 'A' &amp;&amp; ch &lt;= 'Z') {<br />            keyboard_report.modifier = (LED_state &amp; 2) ? 0 : MOD_SHIFT_LEFT;<br />            keyboard_report.keycode&#91;0&#93; = 4+(ch-'A');<br />        } else {<br />            keyboard_report.modifier = 0;<br />            keyboard_report.keycode&#91;0&#93; = 0;<br />            switch(ch) {<br />         case '.':<br />            keyboard_report.keycode&#91;0&#93; = 0x37;<br />            break;<br />         case '_':<br />            keyboard_report.modifier = MOD_SHIFT_LEFT;<br />         case '-':<br />            keyboard_report.keycode&#91;0&#93; = 0x2D;<br />            break;<br />            case ' ':<br />                keyboard_report.keycode&#91;0&#93; = 0x2C;<br />                break;<br />            case '\t':<br />                keyboard_report.keycode&#91;0&#93; = 0x2B;<br />                break;<br />            case '\n':<br />                keyboard_report.keycode&#91;0&#93; = 0x28;<br />                break;<br />            }<br />        }<br />    } else { // key release before the next keypress!<br />        keyboard_report.modifier = 0;<br />        keyboard_report.keycode&#91;0&#93; = 0;<br />    }<br />    <br />    messageCharNext = !messageCharNext; // invert for toggling, key release report must be sent<br />                                       // before next key pressed report<br />    <br />    return STATE_SEND;<br />}<br /><br />usbMsgLen_t usbFunctionSetup(uchar data&#91;8&#93;) {<br />    usbRequest_t *rq = (void *)data;<br /><br />    if((rq-&gt;bmRequestType &amp; USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS) {<br />        switch(rq-&gt;bRequest) {<br />        case USBRQ_HID_GET_REPORT: // send &quot;no keys pressed&quot; if asked here<br />            // wValue: ReportType (highbyte), ReportID (lowbyte)<br />            usbMsgPtr = (void *)&amp;keyboard_report; // we only have this one<br />            keyboard_report.modifier = 0;<br />            keyboard_report.keycode&#91;0&#93; = 0;<br />            return sizeof(keyboard_report);<br />      case USBRQ_HID_SET_REPORT: // if wLength == 1, should be LED state<br />            return (rq-&gt;wLength.word == 1) ? USB_NO_MSG : 0;<br />        case USBRQ_HID_GET_IDLE: // send idle rate to PC as required by spec<br />            usbMsgPtr = &amp;idleRate;<br />            return 1;<br />        case USBRQ_HID_SET_IDLE: // save idle rate as required by spec<br />            idleRate = rq-&gt;wValue.bytes&#91;1&#93;;<br />            return 0;<br />        }<br />    }<br />    <br />    return 0; // by default don't return any data<br />}<br /><br />void caps_toggle(); // defined later in program logic<br /><br />usbMsgLen_t usbFunctionWrite(uint8_t * data, uchar len) {<br />   if (data&#91;0&#93; == LED_state)<br />        return 1;<br />    else<br />        LED_state = data&#91;0&#93;;<br />    <br />    caps_toggle();<br />   <br />   return 1; // Data read, not expecting more<br />}<br /><br />// *********************<br />// *** PROGRAM LOGIC ***<br />// *********************<br /><br />// Routine to return a random character - currently uses the timer 0 as<br />// a source for randomness - it goes from 0 to 255 over 7800 times a second<br />// so it should be random enough (remember, this is called after user<br />// presses caps lock). Of course USB timings may decrease this randomness <br />// - replace with a better one if you want.<br />uchar generate_character() {<br />    uchar counter = TCNT0 &amp; 63;<br />    <br />    if(counter &lt; 26)<br />        return 'a' + counter;<br />    else if(counter &lt; 52)<br />        return 'A' + counter - 26;<br />    else if(counter &lt; 62)<br />        return '0' + counter - 52;<br />    else if(counter == 62)<br />        return '-';<br />    else<br />        return '_';<br />}<br /><br />#define CAPS_COUNTING 0<br />#define CAPS_MEASURING 1<br /><br />static uchar capsCount = 0;<br />static uchar capsState = CAPS_COUNTING;<br /><br />// This routine is called by usbFunctionWrite every time the keyboard LEDs<br />// toggle - basically we count 4 toggles and then start regenerating<br />void caps_toggle() {<br />    if(capsState == CAPS_COUNTING) {    <br />        if(capsCount++ &lt; 1)<br />            return;<br />        <br />        capsCount = 0;<br />        capsState = CAPS_MEASURING;<br /><br />        // Type a message to the PC that we're regenerating the password<br />        memcpy_P(messageBuffer, measuring_message, sizeof(measuring_message));<br />        messagePtr = 0;<br />        messageState = STATE_SEND;<br />    } else {<br />        messageBuffer&#91;capsCount++&#93; = generate_character();<br />        <br />        if(capsCount &gt;= PASS_LENGTH) { // enough characters generated<br />#if SEND_ENTER<br />            messageBuffer&#91;capsCount++&#93; = '\n';<br />#endif<br />            messageBuffer&#91;capsCount&#93; = '\0';<br />            <br />            // Store password to EEPROM - might lose the USB connection, but so what<br />            //eeprom_write_block(messageBuffer, stored_password, sizeof(messageBuffer));<br />            <br />            // Type a message to the PC that new password has been generated<br />            memcpy_P(messageBuffer, finish_message, sizeof(finish_message));<br />            messagePtr = 0;<br />            messageState = STATE_SEND;<br />            <br />            capsCount = 0;<br />            capsState = CAPS_COUNTING;<br />        }<br />    }    <br />}<br /><br /><br />#define abs(x) ((x) &gt; 0 ? (x) : (-x))<br /><br />// Called by V-USB after device reset<br />void hadUsbReset() {<br />    int frameLength, targetLength = (unsigned)(1499 * (double)F_CPU / 10.5e6 + 0.5);<br />    int bestDeviation = 9999;<br />    uchar trialCal, bestCal = 0, step, region;<br /><br />    // do a binary search in regions 0-127 and 128-255 to get optimum OSCCAL<br />    for(region = 0; region &lt;= 1; region++) {<br />        frameLength = 0;<br />        trialCal = (region == 0) ? 0 : 128;<br />        <br />        for(step = 64; step &gt; 0; step &gt;&gt;= 1) { <br />            if(frameLength &lt; targetLength) // true for initial iteration<br />                trialCal += step; // frequency too low<br />            else<br />                trialCal -= step; // frequency too high<br />                <br />            OSCCAL = trialCal;<br />            frameLength = usbMeasureFrameLength();<br />            <br />            if(abs(frameLength-targetLength) &lt; bestDeviation) {<br />                bestCal = trialCal; // new optimum found<br />                bestDeviation = abs(frameLength -targetLength);<br />            }<br />        }<br />    }<br /><br />    OSCCAL = bestCal;<br />}<br /><br />int main() {<br />   uchar i;<br />    <br />    // Fetch password from EEPROM and send it<br />    //eeprom_read_block(messageBuffer, stored_password, sizeof(messageBuffer));<br />    messagePtr = 0;<br />    messageState = STATE_SEND;<br />   <br />    for(i=0; i&lt;sizeof(keyboard_report); i++) // clear report initially<br />        ((uchar *)&amp;keyboard_report)&#91;i&#93; = 0;<br /><br />    wdt_enable(WDTO_1S); // enable 1s watchdog timer<br /><br />    usbInit();<br />   <br />    usbDeviceDisconnect(); // enforce re-enumeration<br />    for(i = 0; i&lt;250; i++) { // wait 500 ms<br />        wdt_reset(); // keep the watchdog happy<br />        _delay_ms(2);<br />    }<br />    usbDeviceConnect();<br />   <br />    TCCR0 |= (1 &lt;&lt; CS01); // timer 0 at clk/8 will generate randomness<br /><br />    sei(); // Enable interrupts after re-enumeration<br />   <br />    while(1) <br />   {<br />        wdt_reset(); // keep the watchdog happy<br />        usbPoll();<br />      // characters are sent when messageState == STATE_SEND and after receiving<br />        // the initial LED state from PC (good way to wait until device is recognized)<br />        if(usbInterruptIsReady() &amp;&amp; messageState == STATE_SEND &amp;&amp; LED_state != 0xff)<br />      {<br />            messageState = buildReport();<br />            usbSetInterrupt((void *)&amp;keyboard_report, sizeof(keyboard_report));<br />        }<br />    }<br />   <br />    return 0;<br />}<br /></code></pre></div><br /><br />And here's the way you test it (if you're using Windows):<br />1. Open Notepad<br />2. Attach Device and wait for &quot;ding&quot; sound<br />3. Hit Capslock, it will type : httpgoogle.com cnn.com yahoo.com ( measuring_message[] string but no&quot;://&quot; )<br />4. Hit Capslock again twice and it will type : New password saved.AAnndd TTrryy TTTToooo TTTyyppeeeee LLLLooooonnngggg TTTTTeeeexxxxtttt<br /><br />The result in the Notepad was the same text, except there's no &quot;://&quot; in the measuring_message[] result which I don't know why. Maybe you can figure it out and post it here <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=":wink:" title="Wink" /><br />As you can see there's no problem with double or repeated with long string.<br />Hope it helps for your research  <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=":wink:" title="Wink" /><br /><br /><br /><blockquote class="uncited"><div>His code doesn't send letters as quick as I'm trying to send them. I don't know if speed matters.</div></blockquote><br />The keyboard rate speed depends on keyboard idle rate which configured automatically by Host, so no need to worried about.<br /><br /><br /><blockquote class="uncited"><div>I've never used the VUSB library before. I'm not sure if I'm even using it correctly.</div></blockquote><br />That's happen to everyone, more practice will help  <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=":wink:" title="Wink" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=7773">declan smith</a> — Sat Jan 19, 2013 5:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[imagiro1]]></name></author>
		<updated>2013-01-18T16:17:21+02:00</updated>

		<published>2013-01-18T16:17:21+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24570#p24570</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24570#p24570"/>
		<title type="html"><![CDATA[Re: Can't send double letters?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24570#p24570"><![CDATA[
That delay was put in there to see if maybe I was trying to send too quickly. It was not the case. <br /><br />It looks like the device is disconnecting. I added a light for testing. I had it just come on when it entered the while(1) loop. I couldn't figure out for the life of me why at some point it would turn off. That delay would explain it. <br /><br />Furthermore, I did more testing. I changed the string to something like &quot;http://google.com cnn.com yahoo.com&quot;. It then sent something like &quot;http:/gogle.com&quot; So it looks like the double letters was just a fluke. But I still can not send a whole string. <br /><br />I've never used the VUSB library before. I'm not sure if I'm even using it correctly. I'm basing my code off code and life's work. His code doesn't send letters as quick as I'm trying to send them. I don't know if speed matters. Hence the delay I had thrown in there.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=19457">imagiro1</a> — Fri Jan 18, 2013 4:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[declan smith]]></name></author>
		<updated>2013-01-18T05:56:36+02:00</updated>

		<published>2013-01-18T05:56:36+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24564#p24564</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24564#p24564"/>
		<title type="html"><![CDATA[Re: Can't send double letters?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24564#p24564"><![CDATA[
_delay_ms(50) ?  what is that for ?<br /><br />that means:<br />- 1 x 50ms delay before &quot;for loop&quot; (not sure for what)<br />- 17 x 50ms delay inside &quot;for loop&quot; (I didn't get it either)<br /><br />give total of more than 800ms before next usbPool()?  and you didn't get device disconnect?  that's strange <img class="smilies" src="./../../../images/smilies/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /> <br /><br />Try to  reduce the delay to under 20ms for total between usbPool() to maintain connection.<br />I don't think the delay needed, but try to use &quot; _delay_ms(1)&quot; if you need it.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=7773">declan smith</a> — Fri Jan 18, 2013 5:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[imagiro1]]></name></author>
		<updated>2013-01-18T04:51:29+02:00</updated>

		<published>2013-01-18T04:51:29+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24563#p24563</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24563#p24563"/>
		<title type="html"><![CDATA[Can't send double letters?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8226&amp;p=24563#p24563"><![CDATA[
Sorta have the string working. I am trying to send a string &quot;http://google.com&quot;. But all I get back is htp:/gogle.com. I can't figure out what I'm doing wrong. Thanks.<br /><br /><div class="codebox"><p>Code: </p><pre><code>char sendString&#91;&#93; PROGMEM = &quot;http://google.com&quot;;<br />    while(1) {<br />        PORTC |= (1 &lt;&lt; PC4);<br />        <br />        wdt_reset(); // keep the watchdog happy<br />        usbPoll();<br />        <br />        _delay_ms(50);<br />        <br />        for (i = 0; i &lt; sizeof(sendString); i++) {<br />            <br />            if(usbInterruptIsReady() ){<br />                <br />                //Send char<br />                //buildReport(sendArray&#91;i&#93;);<br />                <br />                //Send string<br />                buildReport(sendString&#91;i&#93;);<br />                <br />                //PORTC |= (1&lt;&lt;PC4);<br />                <br />                //Send report<br />                usbSetInterrupt((void *)&amp;keyboard_report, sizeof(keyboard_report));<br />                //PORTC &amp;= ~(1 &lt;&lt; PC4);<br />                _delay_ms(50);<br />                <br />                //Clear report<br />                for(j = 0; j &lt; sizeof(keyboard_report); j++){<br />                    ((uchar *)&amp;keyboard_report)&#91;j&#93; = 0;<br />                }<br />            }<br />        }<br />    }<br />    return 0;<br />}<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=19457">imagiro1</a> — Fri Jan 18, 2013 4:51 am</p><hr />
]]></content>
	</entry>
	</feed>
