Help needed to code an Arduino for a project.

Hi,

I have never coded before and I am a starter. This is a group project we had to do, my partner was supposed to code the Arduino as had programming experience before, but he bluffed and bailed out on the project, so it is up to me now to figure out the code for this project.

I dont know where to start. I will need a lot of help.

The mechanism for the project is (My partner sent it to me) :

Using a mechanism similar to one used to fire a pinball, the handle pulls back to compress a string between the plate at the end of the barrel and the plate at the other end of the handle piece (google pinball launcher mechanism or somesuch to get a better idea). The pulley is for the motor to use wire to pull back that mechanism (much like a winch) in order to compress the spring. The wire and mechanism are connected via bungie-hook. The motor should spin, winding up the string until it pulls the spring back enough to get an initial velocity high or low enough in order to hit the target programmed in. The hook is then disconnected and the mechanism fires.

Also we are supposed to have an LED that will turn green when the launcher is ready to launch the ball. (Optional)

Any help in regard to this will be appreciated.

Thank you!

You found the forum. This is a good place to ask specific questions.

Look under "Learning" for "getting started" and "examples" Look around the "playground", you might find something similar that you can modify. There are a lot of examples with switches, LEDs and servos.

There are a lot of good YouTube videos on programming in C and programming the Arduino.

Have you designed and/or built the hardware? Your explanation of what the Arduino needs to do is vague - you need a clearer understanding of it before you can implement that part.

PeterH:
Have you designed and/or built the hardware? Your explanation of what the Arduino needs to do is vague - you need a clearer understanding of it before you can implement that part.

Yes I have. So umm basically the Arduino has to control the motor, so the motor can compress a spring, to launch a pingpong ball to hit a target.

Does this help?

Can you help me out on how to code this?

Do you have the arduino? Can you get "blink" to download to the arduino and run?

We need pin numbers and schematics for the hardware. What are you using to drive the motor? The arduino cannot supply enough current!

KeithRB:
Do you have the arduino? Can you get "blink" to download to the arduino and run?

We need pin numbers and schematics for the hardware. What are you using to drive the motor? The arduino cannot supply enough current!

Yes we have the Arduino, yes the LED function does work when we tried it.

We were going to connect it to an external power supply.

Pin numbers and schematics? Sorry this is the first time I'm using one. Are they the ones on the arduino board?

Thank you!

And oh yes, we also are using a breadboards for the LED placement. If that makes sense.

Good, now program the arduino to move the motor. Since you have not given us the required details, we can't help with that. The best thing is to take baby steps. I know it is frustrating with a deadline approaching, but it is much better to troubleshoot something small and workable than a giant behemoth of a system. I used this approach for my senior project. I had all the components built and tested, and assembled it the night before. I turned it on at 4:00 Am the morning it was due for the first time and it worked. 8^)

KeithRB:
Good, now program the arduino to move the motor. Since you have not given us the required details, we can't help with that. The best thing is to take baby steps. I know it is frustrating with a deadline approaching, but it is much better to troubleshoot something small and workable than a giant behemoth of a system. I used this approach for my senior project. I had all the components built and tested, and assembled it the night before. I turned it on at 4:00 Am the morning it was due for the first time and it worked. 8^)

Can you tell me how I get started?

What details would you need?

No, we cannot do this kind of thing by remote control. You need to see if there is a local arduino club or something to help you out. If you had the hardware designed with only software needed - as you implied in the first post - we might have been able to help.

We do have our hardware ready, we just need the code for the arduino.

How does it connect to the arduino? Can you give us a block diagram of the hardware and how it connects? So far we have nothing.

The hardware is made by using a 3-D printer. We dont have any schematics for that, as we had to make our parts from scratch using SolidWorks.

Sure I will attach a picture of the hardware.

DreamHigher:
We do have our hardware ready, we just need the code for the arduino.

Before you can write the software it is necessary to understand what hardware it needs to control and what it is required to do with that hardware. What sort of motor / drive mechanism are you using, and how are you powering and driving it? You description suggests that you need to vary the spring tension. How will you measure the tension, and how will you know what the target tension is? Your description implies that you will have some sort of release mechanism. Will this be controlled by the Arduino? If so, what is the nature of the release mechanism and how is this powered, driven and controlled by the Arduino? The Arduino only provides simple logic and I/O capability - you need to have sorted out the design of everything outside the Arduino before you can implement the Arduino code.

When you say "we just need the code" I assume you meant to say "we just need to write the code". There are people here who will offer advice with problems you may run into, but don't expect us to write the code for you or to nurse-maid you through doing the whole project.

We are going in circles. We don't need to know what it physically looks like - note I said "block diagram". We need to know how it will work when connected to the Arduino. How is the motor wired? what connections are made to the arduino? what are you using to drive the motor since the arduino cannot supply enough power?

Thank you for everyone who posted on this topic.

@Keith Thank you, you answers were the most helpful, we found a club and they are helping us out.