Arduino nano sense not connecting anymore

Hello everyone,

When I uploaded a new script to my nano sense I can't connect it anymore to my PC. It connects really quick and immediatly disconnects.

Does anyone know how to fix this?

BTW this is the small script I uploaded. I fear the arduino crashes because of the array or something.

int rotarySensorPin = D2;
int val = 0;
long unsigned int timer = 0; 
String sensorValues[10000];

void setup() {
  Serial.begin(9600);
  pinMode(rotarySensorPin, INPUT);
}

void loop() 
{
  
  for (int i = 0; i <= 9999; i++) 
  {
  
    val = digitalRead(rotarySensorPin);
    timer = millis();
    sensorValues[i] = val + "," + timer;
    Serial.println(sensorValues[i]); 
  }
}

Please edit your post, select all code and click the </> button; next save your post.

I'm not familiar with the Nano Sense; maybe a double tap on the reset button will put it in bootloader mode?

Lastly, 10,000 String objects take 60,000 bytes to start with; adding text to one/each element will increase it.

Yes double tapping the reset button made the connection possible.

Thank you

1 Like

You should see a solution checkbox under replies; you can tick the most useful reply so others that find this topic know that it has a solution.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.