Converting c programming code into arduino

Hi

I am undertaking a project which I was using C and pics for however was told to use arduino to make my life easier, however I am new to arduino and not familiar with the language however am told it is very similar to C.

I was just wondering whether there was a way to convert the code from C to arduino? I have attached the code I have written in C if someone could let me know if there was a way to “translate” it, would be very much appreciated.

Thanks

mibcode.c (10.2 KB)

I believe that is too mush work to do for free.

abrownsey: Hi

I am undertaking a project which I was using C and pics for however was told to use arduino to make my life easier, however I am new to arduino and not familiar with the language however am told it is very similar to C.

I was just wondering whether there was a way to convert the code from C to arduino? I have attached the code I have written in C if someone could let me know if there was a way to "translate" it, would be very much appreciated.

Thanks

No need to translate, the compiler used in the arduino IDE is gcc C/C++. You just have to eliminate the main() in your program, place any initialization stuff into a setup function and the rest goes into your loop() function.

So if you already know C you just need to get to work.

am told it is very similar to C.

You were told wrong then it actually is C, what is more it is C++ which is a super set of C. There is no arduino language as such. There are predefined functions which make it look like it isn't C but it actually is.

Most of the code is commented out so there is little left to convert ...

From what platform does this code comes from?

It looks to me like most of that code (though commented out currently) can be replaced with some Serial.print() calls... Maybe using some SoftwareSerial virtual serial ports, or a Mega with multiple hardware serial ports.