<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Sorry the sintax on the define below is wrong.<span class="Apple-style-span" style="font-family: 'times new roman'; font-size: 16px; "></span></div><div><font class="Apple-style-span" face="'times new roman'" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><span class="Apple-style-span" style="font-family: 'times new roman'; font-size: 16px; ">#define WIRING_ECHO_SERIAL=1</span></div><div><br></div><div>should be</div><div><font class="Apple-style-span" face="'times new roman'" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></div><div><span class="Apple-style-span" style="font-family: 'times new roman'; font-size: 16px; ">#define WIRING_ECHO_SERIAL 1</span></div><div><br></div>Also since this is in the core you will need to reselect the board if you are using the arduino to do your&nbsp;compilation.&nbsp;<div>This should force it to recompile the core and extraneous libraries.&nbsp;</div><div>And if you are not sure what it is doing change the build.verbose setting in preferences.txt to give yo more diagnostics.</div><div><br></div><div>Don.</div><div><br></div><div><br></div><div><div><br><div><div>On Apr 5, 2009, at 6:15 PM, Hans Lindauer wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Thanks Don,<br><br>I'm guessing that making this change to the core allows the data to take the most direct route from Rx to Tx?<br><br>Unfortunately, it's still not passing data thru.&nbsp; Do I have this correct?&nbsp; Am I missing curly braces or something?<br><br>#if defined(__AVR_ATmega8__)<br>&nbsp;&nbsp;&nbsp; unsigned char c = UDR;<br>#else<br>&nbsp;&nbsp;&nbsp; unsigned char c = UDR0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #if defined(WIRING_ECHO_SERIAL)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UDR0=c; // write c back to the usart for transmission<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endif<br>#endif<br><br>Thanks,<br>-Hans<br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold; ">From:</span></b><span class="Apple-converted-space">&nbsp;</span>Donald Delmar Davis &lt;<a href="mailto:ddelmardavis@gmail.com">ddelmardavis@gmail.com</a>><br><b><span style="font-weight: bold; ">To:</span></b><span class="Apple-converted-space">&nbsp;</span>"A discussion list for dorkbot-pdx (portland, or)" &lt;<a href="mailto:dorkbotpdx-blabber@dorkbot.org">dorkbotpdx-blabber@dorkbot.org</a>><br><b><span style="font-weight: bold; ">Sent:</span></b><span class="Apple-converted-space">&nbsp;</span>Sunday, April 5, 2009 11:25:50 AM<br><b><span style="font-weight: bold; ">Subject:</span></b><span class="Apple-converted-space">&nbsp;</span>Re: [dorkbotpdx-blabber] (2nd try) Programming Help Needed Please<br></font><br>Hans,<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Since you are only passing the data through without processing it you should intercept and retransmit the bytes in the serial interrupt routine.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">In wiring_serial.c</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">change&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-tab-span" style="white-space: pre; ">        </span><span style="color: rgb(170, 13, 145); ">unsigned</span><span class="Apple-converted-space">&nbsp;</span><span style="color: rgb(170, 13, 145); ">char</span><span class="Apple-converted-space">&nbsp;</span>c = UDR0;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" size="2" face="Monaco"><span class="Apple-style-span" style="font-size: 10px; ">to&nbsp;</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" size="2" face="Monaco"><span class="Apple-style-span" style="font-size: 10px; "><span class="Apple-tab-span" style="white-space: pre; ">        </span>unsigned char c = UDR0;</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" size="2" face="Monaco"><span class="Apple-style-span" style="font-size: 10px; ">#ifdef WIRING_ECHO_SERIAL</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" size="2" face="Monaco"><span class="Apple-style-span" style="font-size: 10px; "><span class="Apple-tab-span" style="white-space: pre; ">        </span>UDR0 = c; //write c back to the Usart Data Register for transmission.<br></span></font></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">#endif</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">and #define WIRING_ECHO_SERIAL=1 somewhere.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">To do it right you should class serial or create a new core, its a bit invasive but its actually what you really want here.&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Don.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Apr 5, 2009, at 11:07 AM, Hans Lindauer wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Let's try this again, without the attachments.&nbsp; You can find them at the provided link.<br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font size="2" face="Tahoma">----- Forwarded Message ----<br><b><span style="font-weight: bold; ">From:</span></b><span class="Apple-converted-space">&nbsp;</span>Hans Lindauer &lt;<a rel="nofollow" ymailto="mailto:armatronix@sbcglobal.net" target="_blank" href="mailto:armatronix@sbcglobal.net">armatronix@sbcglobal.net</a>><br><b><span style="font-weight: bold; ">To:</span></b><span class="Apple-converted-space">&nbsp;</span><a rel="nofollow" ymailto="mailto:dorkbotpdx-blabber@dorkbot.org" target="_blank" href="mailto:dorkbotpdx-blabber@dorkbot.org">dorkbotpdx-blabber@dorkbot.org</a><br><b><span style="font-weight: bold; ">Sent:</span></b><span class="Apple-converted-space">&nbsp;</span>Sunday, April 5, 2009 10:41:47 AM<br><b><span style="font-weight: bold; ">Subject:</span></b><span class="Apple-converted-space">&nbsp;</span>Programming Help Needed Please<br></font><br><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">OK, I have (hopefully) one line to program to finish my re-write of my MIDI lights firmware.&nbsp; It's the line that modifies the MIDI library so that it passes any incoming bytes to the THRU port.<br><br>In my old program, I just did a Serial.read follower by a Serial.print, as follows:<br><br>void loop () {<br>&nbsp; if (Serial.available() > 0) {<br>&nbsp;&nbsp;&nbsp; newbyte = Serial.read(); // read the incoming byte<br>&nbsp;&nbsp;&nbsp; Serial.print(newbyte); // echo the incoming byte<br>...<br><br>I tried that again here, but with no luck.&nbsp; Then I looked at how they send data to the serial port for MIDI OUT in the library, and saw that they use a slightly different syntax: serial_.print (b, TYPE).&nbsp; So I tried adding that instead, as follows.&nbsp; I've included an extra snippet that shows how they're doing it, for context.&nbsp; My line is the one with the asterisks.&nbsp; I assumed that I could ignore the type argument, since I'm just passing the (int) variable c straight thru.&nbsp; (I also tried it as INT and BYTE types):<br><br><br>// Try to read data at serial port &amp; pass anything read to processing function<br>void Midi::poll(void)<br>{<br>&nbsp;&nbsp;&nbsp; int c;<br><br>&nbsp;&nbsp;&nbsp; // Just keep sucking data from serial port until it runs out, processing<br>&nbsp;&nbsp;&nbsp; //&nbsp; MIDI messages as we go<br>&nbsp;&nbsp;&nbsp; while((c = serial_.read()) != -1) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; recvByte(c);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serial_.print(c); // ***** pass MIDI data THRU *****<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br><br>// Send Midi NOTE OFF message to a given channel, with note 0-127 and velocity 0-127<br>void Midi::sendNoteOff(unsigned int channel, unsigned int note, unsigned int velocity)<br>{<br>&nbsp;&nbsp;&nbsp; int status = STATUS_EVENT_NOTE_OFF | ((channel - 1) &amp; 0x0f);<br>&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span><br>&nbsp;&nbsp;&nbsp; if (sendFullCommands_ || (lastStatusSent_ != status)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serial_.print(status, BYTE);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span><br>&nbsp;&nbsp;&nbsp; serial_.print(note &amp; 0x7f, BYTE);<br>&nbsp;&nbsp;&nbsp; serial_.print(velocity &amp; 0x7f, BYTE);<br>}<br><br><br><span>If it helps to see the full library code from<span class="Apple-converted-space">&nbsp;</span><span><a target="_blank" href="http://timothytwillman.com/?page_id=240">http://timothytwillman.com/?page_id=240</a>, it's attached (this snippet is in midi.cpp).&nbsp; Please let me know if you have any ideas.&nbsp; By the way, this MIDI library seems to work pretty well otherwise (with only one light).</span></span><br><br>Thanks,<br>-Hans<br></div></div></div></div></div></div>_______________________________________________<br>dorkbotpdx-blabber mailing list<br><a rel="nofollow" ymailto="mailto:dorkbotpdx-blabber@dorkbot.org" target="_blank" href="mailto:dorkbotpdx-blabber@dorkbot.org">dorkbotpdx-blabber@dorkbot.org</a><br><span><a target="_blank" href="http://music.columbia.edu/mailman/listinfo/dorkbotpdx-blabber">http://music.columbia.edu/mailman/listinfo/dorkbotpdx-blabber</a></span></div></span></blockquote></div><br></div></div></div></div>_______________________________________________<br>dorkbotpdx-blabber mailing list<br><a href="mailto:dorkbotpdx-blabber@dorkbot.org">dorkbotpdx-blabber@dorkbot.org</a><br><a href="http://music.columbia.edu/mailman/listinfo/dorkbotpdx-blabber">http://music.columbia.edu/mailman/listinfo/dorkbotpdx-blabber</a></div></span></blockquote></div><br></div></div></body></html>