Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
Page Index Toggle Pages: 1
Send Topic Print
Writing in C and not C++. (Read 2881 times)
zain ul-abidin

Posts: 1
Writing in C and not C++.
Feb 3rd, 2014 at 2:41pm
Hi Guys
I have only just started using visual micro with atmel studio. I am beginner in C as well. When I create a new "Sketch project" it only creates a C++ template. I have tried to create a new c template through project> add new sketch item> C template but its not building properly.Please advise how can I write my code in C. Thank you!
Back to top
IP Logged
Visual Micro

Posts: 10902
United Kingdom
Re: Writing in C and not C++.
Reply #1 - Feb 3rd, 2014 at 5:21pm

The Arduino projects we create in Visual Studio (or Atmel) have the same rules and structure as the sketch projects created in the Arduino Ide.

We hope that users will first use the Arduino Ide so that they understand the Arduino rules and the way it works.

The Arduino.cc web site and arduino.cc/forums are also a great resource for standard development questions. This web site is to support the Visual Micro plugin and features but really the best and cleverest developers can be found on the arduino.cc web site  Smiley

I don't know if this answers your question but Arduino is a C++ system, you can add .c files as long as they are added to the same folder (not sub folder) of the sketch. You will need to manually #include the .c source from a Cpp or .ino source.

A base Arduino project is simply a single .ino and folder of the same name. You can add more .ino, .cpp, .c, .h sources to meet your needs a long as they follow the Arduino rules.

For reasons of support, Visual Micro does not allow the Arduino rules to be broken but you don't have to use Visual Micro. As an advanced developer, which you obviously are, you will find that you can use Atmel Studio and .bat files to write your own version of an Arduino compiler/builder.

I hope this helps.
Back to top

Tim Leek
IP Logged
Page Index Toggle Pages: 1
Send Topic Print