Hi Marland,
Thanks for your email it explains a lot. Your code is very interesting and we will consider supporting it in the not to distant future.
Currently we support 'standard' Arduino sketch code as described on arduino.cc. I say standard because you might consider your code to be more 'standard' in the wider c++/micro-controller world. However for Arduino your code is quite different and overrides the standard arduino core initialization. Not a problem and actually your code variation is quite neat and efficient.
Here are some points of note about arduino
1. All the .ino sources within a project are combined into a single .cpp during compile
2. Prototypes are automatically created for all methods in an .ino (can be disabled in options)
3. The master sketchname.ino should contain the void setup() and void loop() methods (no class required)
4. The Arduino core contains a main.cpp that calls setup() then loop() when the mcu starts
5. .cpp and .h files are allowed but use the Visual Micro "Add>New>New Cpp Item" once so you can see what a standard Arduino #include header looks like
6. Libraries referenced from .cpp need to be #included in the master.ino file. (use the visual micro menus to import libraries when needed so you can see what is #included.
Your code is as follows (let me know if you would like me to remove and keep private but it seems like test code)
class blink2
{
public:
static void setup();
static void loop();
};
void blink2::setup()
{
/* add setup code here */
pinMode(13,OUTPUT);
}
void blink2::loop()
{
/* add main program code here */
digitalWrite(13,HIGH);
delay(1000);
digitalWrite(13,LOW);
delay(1000);
}
int main(void)
{
blink2 bc2 = blink2();
bc2.setup();
for(;;)
{
bc2.loop();
}
}
Please change you code as follows to the arduino recommended way of writing code for .ino sources:- void setup()
{
/* add setup code here */
pinMode(13,OUTPUT);
}
void loop()
{
/* add main program code here */
digitalWrite(13,HIGH);
delay(1000);
digitalWrite(13,LOW);
delay(1000);
}
You can still use classes but the setup and loop need to be as shown above and no main() is required for Arduino. setup() can be used for one time processing.
Sorry if you know some or all of this
Thanks