Electronic – Arduino killed trying to load a sketch

arduinoavr

I'm trying to build RGB led color picker from ladyada.net tutorials.
http://www.ladyada.net/make/eshield/examples.html

I build ethernet shield, installed on my Arduino Duemilanove with ATMEGA328 and then load the sketch from ladyada web site.
http://www.ladyada.net/make/eshield/LEDcolorpicker.pde

This code dosent's work for me, until I break line into two separate and re-merge at runtime.
I need to remove some piece of code to make it works.

After burning 3 times this sketch on my Arduino, it seems not to responde anymore.
On extensive log I see:

     avrdude: Version 5.4-arduino, compiled on Oct  9 2007 at 11:20:31
     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

     System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
     User configuration file is "/Users/emaaaa/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port            : /dev/tty.usbserial-A9007MIy
     Using Programmer      : stk500v1
     Overriding Baud Rate  : 115200
     avrdude: Send: 0 [30]   [20] 
     avrdude: Send: 0 [30]   [20] 
     avrdude: Send: 0 [30]   [20] 
     avrdude: ser_recv(): programmer is not responding
     avrdude: stk500_recv(): programmer is not responding
     avrdude: Send: Q [51]   [20] 
     avrdude: ser_recv(): programmer is not responding
     avrdude: stk500_recv(): programmer is not responding

Anyone have some ideas ?
I tryed on 2 different arduino 2009, same results

Thanks.

Best Answer

The const char javascript[] PROGMEM = "..." is a >5,000 character string. It's possible that the Arduino IDE doesn't support line lengths of this size, you can break it up using the continuation character \ at the end of your line:

const char javascript[] PROGMEM = "<script type=\"text/javascript\">function" \
" getScrollY(){var scrOfX = 0,scrOfY=0;if(typeof(window.pageYOffset)=='number')" \
"{scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&" \
[Many more lines]
"setCCbldSty2('colorpicker201','ds','block');" \
"document.getElementById('colorpicker201').innerHTML=mid;}</script>";

Note that you can't have // comments at the end of these lines.

If this is what you meant by "broke into 2 parts" you should be fine. Otherwise, I think your reassembly at runtime is suspicious.