Hello
I was busy working on a project (containing many classes) when suddently the arduino became unresponsive
I simplified the project to figure what was causing this
basicaly, one empty C++ class is added to the project
from the moment that class is instanciated staticaly or simply declared as a pointer, the arduino - once programmed - disappear as an usb device
I have to reset it to program it again, here is the main code :
#include "main.h"
Main* main; // this crashes the arduino
//Main main; // this too
int led = 13; // simple test code from examples
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
here is the culprit class :
#ifndef MAIN_H
#define MAIN_H
class Main
{
public:
Main();
};
#endif
and its implementation :
#include "main.h"
Main::Main()
{
}
I tried renaming the class too, just in case of conflict
I thought my arduino was fried, I tried with another one, same thing
I use sublime text, I noticed the arduino ide was sometimes out of wack, so I had to restart it
this makes no sens at all
can someone confirm this ? anything wrong with the code ? I feel I miss something really obvious, but I double checked everything
regards