Just started playing with Arduino, but now I can no longer upload. In hindsight I believe I have locked up the serial output. The Arduino still runs the last Sketch I loaded at the time I was able to view the output via the COM port but after disconnecting the Nano and the reconnecting it was unable to connect. Eventually I managed to get it to re appear in device manager by downloading the FTDI drivers from the FTDI website (pointing at the Arduino IDE installation did not work) and manually adding the device.
I only put the print to serial in to assist with debugging a problem with loop. When the sketch runs initially there is a small delay in output to the serial, but after a very short while there is no delay, hence I effectively see the tx light stay on with the following error:-
avrdude: stk500_getsync(): not in sync: resp=0x00
I have tried the following, from similar information I have found.
- Tried uploading the minimal sketch, connecting/release reset button at the point the actual upload starts.
- Shorting the TX to ground, so as not to flood the output.
- Program via a Atmel AVR JTAGICE mkII programmer connected to the icp pins (I could not get this to identify the connection).
The sketch is below (it drives NeoPixlels /WS2812B Leds).
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
#include <Adafruit_NeoPixel.h>
// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 5
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 5
// Preset Reg, Green, Blue values
int R = 0;
int G = 0;
int B = 100;
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 50; // delay for half a second
void setup() {
pixels.begin(); // This initializes the NeoPixel library.
Serial.begin(9600);
}
void loop() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
//for(int i=0;i<NUMPIXELS;i++){
//for (int thisPin = 2; thisPin < 8; thisPin++) {
//for (int R = 0; R < 150; R++)
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
if (B > 5)
{
// int RA = random(0,10);
//int GA = random(0,10);
// int BA = random(0,10);
// int RB = random(0,10);
// int GB = random(0,10);
// int BB = random(0,10);
Serial.println(B, DEC);
pixels.setPixelColor(0, pixels.Color(0,B,B)); // Moderately bright green color.
pixels.setPixelColor(1, pixels.Color(0,B,B));
pixels.setPixelColor(2, pixels.Color(0,B,B));
pixels.setPixelColor(3, pixels.Color(0,B,B));
pixels.setPixelColor(4, pixels.Color(0,B,B));
delay(50);
pixels.show(); // This sends the updated pixel color to the hardware.
B=B-1;
}
else
Serial.println("Subtract");
}
Any help most appreciated.