Pages: [1]   Go Down
Author Topic: Arduino Software Help Needed  (Read 560 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 50
Posts: 1766
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 50
Posts: 1766
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 07, 2013, 04:45:08 pm by MichaelMeissner » Logged

The Netherlands
Offline Offline
Edison Member
*
Karma: 35
Posts: 1299
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If you just "happened to stumble upon" it

 smiley-cool

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

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Pages: [1]   Go Up
Jump to: