General functionality question

So without going into great detail I would like to know if it is possible to create coding using an arduino that would allow for a series of say 3 functions..i.e..... rotate a servo..then rotate a stepper then extend/retract a linear actuator.

I know that the above is likely a simple task for the arduino...here’s the meat of my question...

I would like to know if using the above 3 functions let’s say I would like to have 4 different programs with each having little differences in time/speed of each individual function.. on top of that I would need to be able to select from one of the 4 programs using a basic controller... (maybe a simple button box) I will not have a computer available in the field of use. Is it possible to program the arduino to run independently of a computer and still be able to select and run any one of the 4 determined programs?

I am brand new to arduino and despite many searches online have not been able to get a great answer to my scenario...

Thanks for any and all responses.
Brian

Yes

Yes, easily.

Thanks for the speedy responses, I assumed this was possible but wanted to verify prior to pouring hours into learning arduino and coding/programming. I guess a follow up question might be are their arduino coders/programmers available for hire? I will be very busy building the physical structure.

You can start a topic in Jobs and Paid Consultancy - Arduino Forum. You will however have to give a more detailed description than in this topic.

1 Like

You need to have a VERY clear understanding of your requirements before coding especially if you are paying someone otherwise frustration and expense will ensue. On paper you need to have information on every component you use and how it can connect to the microcontroller in a schematic with links to data sheets. You need to draw a flow diagram that shows EXACT functionality with timing. Do not assume anything. Remember coding is like a language which requires total clarity, any ambiguity will lead to problems.

Look at the myriad of posts here and you will see this is not a trivial task and many people are incapable of describing things with any clarity

Look at this post for an example

3 Likes

A good one will spend the first hour(s) ensuring your requirements are clearly articulated... tbh.. this is the hardest part. Once the requirements are clear the coding is usually fairly trivial to a good developer.

1 Like

Indeed, we are in the very early stages of developing the idea/parameters of the project. I think it would be to our benefit to learn basic arduino programming and coding/schematics prior to reaching out to a professional but once we are ready to collaborate with a professional programmer it is nice to know that is available.. this particular project will be very basic for most of the advanced users here but revolutionary for the purposes it will serve.. I thank you all for the responses..

It is really useful to understand your own project including the code but it is not necessary. Most significant projects outsource parts such as coding. The thing you need to understand is that the code is going to be an exact translation of the requirements you specify. If you specify incorrect requirements then the code will reflect this and your project will not do as you intend. There is often a big gap from one persons internal vision to the clear expression of that which others can understand. People assume important concepts are universally understood and therefore omit to include them in a description in which case they will also be omitted from the code.
The microcontroller will not make any decisions or judgements it will do EXACTLY as it is coded!

The task you describe is trivial for a uC and the code required would not be difficult to learn. It would give you a very clear understanding of your project to formulate it yourself. You can always get it done professionally after the prototype is running to make it tidy if needed

1 Like

That will be an interesting bit of work in its own right, probably, and who knows, you may find it within your powers to do the whole project. If not, as noted by @pmagowan you may at least get it to the prototype stage.

But this is the key part:

... and you are very wise to be spending time doing that to avoid later confusion (as a minimum) and liability claims and litigation (worst case).

If I were you I'd look into the various methods of documenting needs. There are loads of ways to do it, including traditional box and diamond flowcharts, state diagrams, swim-lane diagrams, etc etc. Whether you end up doing the code yourself, or farm it out, having the requirements well documented provides a shared understanding across all those involved and prevents those "But I thought it was supposed to work like this not like that" discussions later on.

Nobody would ever think of building a house without drawing the plans so that a) everyone can agree on the layout and finishes etc etc and b) the builder knows what to do. Yet in the world of software, even pros sometimes dive into the code too early and then end up down an ever-deepening rabbit hole.

The thread linked from reply #6 is a very good, bad example :wink:

1 Like

Give some thought to how you're going to test the software if you have someone else code it. Will you give them a prototype to work on?

If not, a decent programmer is going to have a large number of versions for you to test. A common methodology is to write one separate program for each piece of hardware to prove that they can control it. Only then do these get combined one by one and then functionality is added a piece at a time.

All this to say - programmers run a lot of tests, so be aware of the time commitment if it's you running them.

Also, the need for clear requirements mentioned above is key, but however good they are, there will still be misunderstandings or you will realize that there are changes needed. So the build will very likely have multiple iterations.

And if you do it yourself read the guides here. Be iterative. Work on one bit at a time. Save regularly to separate sketches with a clear naming scheme. Once code works start thinking about encapsulation where the block of code works independently of other code and doesn’t make a mess when combined. You should always have the last working iteration saved and a current iteration that you are working on. Bugs live in the difference between the two.

1 Like

Yes, I have a lot of experience doing this. The best suggestion I can offer is to get a programmer /consultant engaged early on before you start deciding on hardware/electronics/physical layout, etc.

A lot of the projects I'm called into are for people who have bought a bunch of hardware and floundered around a bit before they find me and ask me to make it all work together. Probably half the time they've made the wrong selections and I have to tell them they're better off just starting over.

2 Likes

And, that often leads to 'fishing' for the software provider willing to walk into the trap, whether they're hungry or just unaware/overconfident.

But they then AF like there's an endless supply of money... Nope.

1 Like

I look at it as 3 possibilities.

  • I have all the hardware on hand and I can test using that (I have lots of hardware).
  • I need to buy hardware to test so I build it into the price.
  • User has specialized hardware and either has to ship it to me, or I build a copy and charge for that.

The one exception that worked was when I was writing code for a physically large, very expensive machine. In that case we set up a remote PC and camera at the site and I logged in via Teamviewer and used the camera to observe that the carriages moved to the right locations, etc.

1 Like

The project will likely require remote access and oversight with visual access. I have ordered some reading materials and a starter kit to familiarize myself with terminology and functionality of the arduino. I will be reaching out to programmers when I have a better understanding of the communication required to make dialogue two way. With this project, once fully operational there would be additional customer specific programming that would need to be written. If this project finds success there would be additional income for the right programmer. That being said at this time I thank you all for your responses and will reach out to the programmers once I have at least a basic understanding of the programming process..

Better to say that many people do not understand how difficult it is to describe a problem with the clarity necessary to have someone else write code for them.

1 Like

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