Arduino Software Help Needed

If I have a program written in objective c (written on a mac), how would I use that program to use my robot arm using an arduino mega?

Well at a guess I'd say you would have to copy / paste it into the Arduino IDE, then panel-beat it until it compiles as an Arduino sketch. As a minimum it would need to have the setup() & loop() structure, but would also need to use the various "Arduino-C" commands to read and write pins and so on, and also call whatever libraries it needs, like for instance to control servos.

So essentially it would need to be translated into the format you described to be used by the arduino? Around how long would that take?

Around how long would that take?

Beats me..... Impossible to tell, surely?

It's unlikely to look anything like an Arduino sketch, even though it's in C. What's in there that the Arduino sketch can use? It's going to need (probably) the servo library and therefore use a whole bunch of commands to (eg) attach and write to the servo.... Probably going to need some commands to read sensors through various pins.

Might be easiest to start from scratch, in fact?

It depends on how complex the program is, how much it uses stuff in the Objective C environment that would have to be mapped to equivalences in the Arduino environment, whether the program will fit in the Arduino's memory space, and your skill level as a programmer. A lot of times, it might be simpler to start over, and recode it from scratch, using the Objective C program as a template, than it would be to do a mechanical translation. Assuming you have little programming experience, it might be a long and painful task (but presumably if you finish, it will teach you a lot about programming).

Thanks for the help. If anyone is very familiar with programming, would this job be reasonable to accomplish in a less than a week for a moderate to experienced programmer? Would this be a relatively simple job for someone familiar with programming?

armondjune:
Thanks for the help. If anyone is very familiar with programming, would this job be reasonable to accomplish in a less than a week for a moderate to experienced programmer? Would this be a relatively simple job for someone familiar with programming?

If you don't post the program, we would just be guessing. It may be simple, it may not be. You need to use the '#' button above the text area to generate code tags, and put the program inside of the tags.

armondjune:
If I have a program written in objective c (written on a mac), how would I use that program to use my robot arm using an arduino mega?

Did you write that program yourself ?
If you did, you know it and how it was built.
If you just "happened to stumble upon" it, you will probably have to guess a lot.

This will have a big impact to the time you would need to convert it.
But how do you know this program will work and do what you want it to do ?
You will see you'll need to do some debugging before your setup will do what you expect it to do.

If you just "happened to stumble upon" it

Is that "stumble" as in "Googled for a ready-made answer to a college project"?....