Go Down

Topic: Arduino Software Help Needed (Read 746 times) previous topic - next topic

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?

JimboZA

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.
My hovercraft is full of eels.

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

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?

JimboZA

Quote
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?
My hovercraft is full of eels.

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

MichaelMeissner

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?

MichaelMeissner

#6
Feb 07, 2013, 08:46 pm Last Edit: Feb 07, 2013, 10:45 pm by MichaelMeissner Reason: 1

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.

MAS3

Quote from: 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.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

JimboZA

Quote
If you just "happened to stumble upon" it


8)

Is that "stumble" as in "Googled for a ready-made answer to a college project"?....
My hovercraft is full of eels.

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

Go Up