Arduino IDE and C language

Dear All,

I want to write customized program in Arduino IDE platform using C language, so is it possible?

If any body gas tutorial or programming instruction then please share tutorial link.

Thanks and Regards,

Jignesh Doshi

The Arduino language is C/C++. You can easily Google hundreds of tutorials.

The .ino files of the sketch are compiled as C++ after some minimal preprocessing to make it valid C++.

If you add files to the sketch (shown as tabs in the Arduino IDE) with the .c file extension, these will be compiled as C. You can do that via the Arduino IDE by following these instructions:

  • Click the downward pointing triangle button on the right side of the Arduino IDE's tab bar.
  • Click "New Tab".
  • In the "Name for new file" field, type the filename you want, adding the .c file extension at the end.
  • Click the "OK" button.

Every sketch must contain at least one .ino file, but you are welcome to leave that file blank and implement a complete C program in the .c file. If you do this, the .ino file can be a handy place to write introductory comments or notes. Or you are welcome to write sketches that are any combination of Arduino Programming Language, C++ (use the .cpp file extension), and assembly (use the .S file extension). Just keep in mind that the .ino files will be compiled as C++, not C.

However, if you're not absolutely set on using C, then I would recommend you just use the Arduino Programming Language/C++ in the .ino files of the sketch. I think that will provide the best experience.

If i want to interface external ADC then how can i do?

jignesh0310:
If i want to interface external ADC then how can i do?

you read the spec of the "external ADC" and depending on its interface you write code matching the spec... best answer I can give based on the info you shared

You may find an existing library in the Arduino community, or indeed, you could be able to use the onboard ADC.

What’s your application and experience?

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