I have been watching hours and hours of how to videos on using the Arduino and of the c++ programing. I have been able to use the lcd screen, had the servo sweep, and blinked more led's than a park at Christmas. These things are all very simple as everything is laid out and program is written. What I want to be able to do is figure out how hook things up and program them to work. For example I took apart an old Gateway tower and I want to use the fan and power on/off button to control the fan. I also want to use the servo to control a pin on a locking mechanism that I made on my mill and lathe. I was able to power up the fan by connecting it to 5v and the ground, however when I went to hook it up with the power button and program it to work I was unable to do it. What I am looking for is someone to help me accomplish this, not tell me exactly what to do but some guidance and answer my questions as I go. I think this type of approach will help me to learn quickly and things will start to click. I am not up to par with computers and have limited experience with electronics, I am however extremely eager to learn. I hope this doesn't seem like I am to lazy to watch videos and read because that is what I have been doing for the past week and about 12 hours per day if not more. So here is what I have: fan has three wires white, black and red; red is pos black is neg and white I think is either a common or input. I am not saying this is how it is, it is more of what I think. Power button has 2 led's connected to it; the button has a blue and orange, left led has red and white, right led has green and black at the plug end there is a brown jumper wire. My thought is one of the led is on when the switch is on and other is on when switch is off so to wire that it the white and green would go to ground on breadboard, the red would go to pin 12 and the black would go to pin 13. then it the Arduino the program would state if the button is in this state pin 12 would be high if not pin 12 would be low if pin 12 is high pin 13 is low if 12 is low 13 is high. that leaves the orange and blue from the switch, orange is 5v, blue neg. I know this probably isn't close to correct so if someone could explain what gets hooked up where and why. This is just a start so please don't be to harsh
Hi,
I have been watching hours and hours of how to videos on using the Arduino and of the c++ programing.
I have been able to use the lcd screen, had the servo sweep, and blinked more led's than a park at Christmas.
These things are all very simple as everything is laid out and program is written.
What I want to be able to do is figure out how hook things up and program them to work.For example I took apart an old Gateway tower and I want to use the fan and power on/off button to control the fan. I also want to use the servo to control a pin on a locking mechanism that I made on my mill and lathe. I was able to power up the fan by connecting it to 5v and the ground, however when I went to hook it up with the power button and program it to work I was unable to do it.
What I am looking for is someone to help me accomplish this, not tell me exactly what to do but some guidance and answer my questions as I go.
I think this type of approach will help me to learn quickly and things will start to click.
I am not up to par with computers and have limited experience with electronics, I am however extremely eager to learn.
I hope this doesn't seem like I am to lazy to watch videos and read because that is what I have been doing for the past week and about 12 hours per day if not more.
So here is what I have:My thought is one of the led is on when the switch is on and other is on when switch is off so to wire that it the white and green would go to ground on breadboard, the red would go to pin 12 and the black would go to pin 13.
Then in the Arduino the program would state if the button is in this state pin 12 would be high if not pin 12 would be low if pin 12 is high pin 13 is low if 12 is low 13 is high.
That leaves the orange and blue from the switch, orange is 5v, blue neg.
I know this probably isn't close to correct so if someone could explain what gets hooked up where and why.
This is just a start so please don't be to harsh
Tom.... ![]()
Thank you Tom - I was about to ignore this Thread because it was unreadable.
I think you missed this bit
So here is what I have:
- fan has three wires white, black and red; red is pos black is neg and white I think is either a common or input. I am not saying this is how it is, it is more of what I think.
- Power button has 2 led's connected to it;
- the button has a blue and orange,
- left led has red and white,
- right led has green and black
- at the plug end there is a brown jumper wire.
...R
@Brentb1, I don't know how to advise you.
The colours on wires are generally meaningless unless you have the manufacturers data sheet.
To be honest, I can't understand what you are trying to achieve.
Maybe the best thing would be for you to have a go at writing your program and also prepare a diagram (a simple pencil drawing is best) showing how you propose to connect things.
Then we will have something specific that we may be able to help you with.
...R
Yeah I totally understand what you are saying, I guess I wrote the post out of frustration of to much info and not sure where to start. Thanks for even taking the time to respond to my confusing post. I broke out my electronics book from a course I took in college "which was 8 years ago". I figure I will start from the basic circuits and then move to the Arduino. As far as writing the code first that is my biggest problem is I just draw a complete blank. When I have someone going through the steps with me and explaining things as we go I catch on quick; otherwise I spend my time watching a million videos and get info overload. I guess my learning style is different. I had a 4.0 throughout my degree in business but cant figure out the Arduino program... Pathetic! Thanks again
The most important mistakes a beginner makes is trying to do a large project all at once. You need to get a LED to blink then get a button to work. Once you get everything to work indepently, start combining them. Once you get to this point, you will have learned enough that this will be easy.
Brentb1:
Yeah I totally understand what you are saying, I guess I wrote the post out of frustration of
Your writing is still confusing. Please learn from what @TomGeorge did to make your Original Post readable and don't write everything in a single paragraph.
Your Reply #5 is much easier to read like this - look at how many different strands of thought it contains
Yeah I totally understand what you are saying, I guess I wrote the post out of frustration of to much info and not sure where to start.
Thanks for even taking the time to respond to my confusing post.
I broke out my electronics book from a course I took in college "which was 8 years ago". I figure I will start from the basic circuits and then move to the Arduino.
As far as writing the code first that is my biggest problem is I just draw a complete blank.
When I have someone going through the steps with me and explaining things as we go I catch on quick; otherwise I spend my time watching a million videos and get info overload.
I guess my learning style is different. I had a 4.0 throughout my degree in business but cant figure out the Arduino program... Pathetic! Thanks again
I wonder if part of your difficulty with your project is that you are jumbling all of your thinking about it into a similar single big "paragraph"
Have a look at Planning and Implementing a Program
...R
Hi Brent,
Don't worry about trying to get it all understood before you put your device together. Concentrate on how to make your fan work with an arduino. The link in the first reply (from ieee488) tells you how to do that. This makes a good project, after you have done a handfull of the pertanent examples from the IDE's examples menu. If you get stuck on a step, come here and ask a specific question.
It may seem slow going to work that way, but the learning curve takes little time when compared to the frustration of 'jumping right into the deep end' as you have been doing with all the videos, etc.
ps, Robin is not being mean. Your posts are hard to read, since all the concepts are in a single paragraph. Hit the 'enter' key a couple times between thoughts and your writing will make more sense to the folks here, who are really quite helpful.
I see the point you are all making and it is a valid one. I kind of have this idea with everything that I need to learn it all now.
As far as my post being hard to read you are correct, when I went back and read my post I confused the sh!t out of myself.
Robin2 I believe you are right, my thoughts are exactly like that. I am just having all this running through my head and get frustrated because I know it is not hard if I can just figure out what step 1 is and have basics understood.
I hope this is easier to understand " I am not being sarcastic either" I thank all of you that took the time to reply and explain what I need to do. Thanks
I decided to take on a project that would be helpful to me. I am using 2 servos to ultimately control a security camera.
I was able to get both servos working via joystick; the problem I have is the servo returns to the start position once I let go of joystick.
My goal is to be able to move the camera to a certain position and stay in said position until I want to move it else where.
The code I used is:
// Controlling movements of two servos using a Joystick
// Joystick's x- and y- axes are connected to A0 and A1 analog pins of Arduino.
// Servos are connectd to PWM Pins 9 and 10.
// By Explore Labs
#include <Servo.h>
Servo tilt, pan; // create servo object to control a servo
int joyX = A0; // analog pin used to connect the X - axis of Joystick
int joyY = A1; // analog pin used to connect the Y - axis of Joystick
int x, y; // variables to read the values from the analog pins
void setup()
{
tilt.attach(9); // attaches the tilt servo on pin 9 to the servo object
pan.attach(10); // attaches the pan servo on pin 10 to the servo object
}
void loop()
{
x = joyX; // reads the value of the Joystick's X - axis (value between 0 and 1023)
y = joyY; // reads the value of the Joystick's Y - axis (value between 0 and 1023)
x = map(analogRead(joyX), 0, 1023, 900, 2100); // scale it to use with the servo b/w 900 usec to 2100 usec
y = map(analogRead(joyY), 0, 1023, 900, 2100);
tilt.write(x); // sets the servo position according to the scaled value
pan.write(y);
delay(15); // waits for the servos to get there
}
I hope I explained this better than my other posts
Brentb1:
I was able to get both servos working via joystick; the problem I have is the servo returns to the start position once I let go of joystick.
I think the code in this Thread will deal with that problem.
...R
Thank you for the code, it worked just like I needed it to.
Next question, in order to get two servos to work with 1 joystick can I just copy and past the code for the servo and add a different pin?
I would also use the other pin from the joystick "x and y" which I would also add that to the code.
If that can be done I would like to give it a try and if I am unable to get things to work out I can post what I did and get some advice.
Thanks again, much appreciated
Brentb1:
Next question, in order to get two servos to work with 1 joystick can I just copy and past the code for the servo and add a different pin?
Probably.
If you have been experimenting (as you should) you probably have already figured it out much quicker than asking questions on the internet. The Arduino is great for learning-by-doing
...R
Actually it is a lot quicker to ask the question on the internet. Just saying.
The reason I asked is if it is not able to be done with the code I figured I could get a quick no.
I did not ask to do it for me, just wanted to know if it can be done. Then I would proceed.
I might have this site wrong, I thought I was for people that are learning to get some direction, if that is not the case please let me know so I can stop posting. Thanks again for the reply.
Brentb1:
I might have this site wrong, I thought I was for people that are learning to get some direction, if that is not the case please let me know so I can stop posting. Thanks again for the reply.
I did not mean that you should not ask the question.
I literally meant what I said - that an experiment would produce an answer quicker (IMHO) and I like to encourage people to experiment.
...R
I understand that. My point is this; I don't know enough to experiment without know the outcome would work.
Meaning, if you say yes that will work then I will experiment until I figure it out. Going from point A to point B is difficult if you don't know if point B exists.
It's whatever, I just want to understand this thing
Brentb1:
Actually it is a lot quicker to ask the question on the internet. Just saying.
I would have to disagree. I am the type of person who learns better by trial and error and also love to use google. It takes time to get a reply to a question. Since your question in reply #12 was vague, you received a vague answer. We like specific questions.
Meaning, if you say yes that will work then I will experiment until I figure it out. Going from point A to point B is difficult if you don't know if point B exists
.
Where is the fun in that?
Brentb1:
Meaning, if you say yes that will work
In Reply #13 I said "probably" rather than "yes" because I could not guess exactly how you proposed to adapt the code. It would be very easy to do what you proposed "just copy and past the code for the servo and add a different pin" in such a way that it would not work.
...R
codlink, good for you. I am the type of person who asks people that have been there done that; and then figure it out.
As far as being vague, I would have to disagree it was a pretty simple question. Maybe you should reread it. I do not think it was a vague answer either it seemed pretty direct.
Where is the fun in that; I will tell you. I am trying to get the knowledge of the Arduino to make my daughters life easier for her. So fun; I am not learning this for fun it is for a purpose. I was hoping the people on this site who are smarter than me can aid me in getting this done for her.
Read my only other thread and you can see what I am trying to accomplish. My goal is not to turn a servo and pat myself on the back. I understand I sound like a moron asking these questions but I am willing to swallow my pride to get this done.
Now robin2 you are correct, this has become a time consuming endeavor and a waste of time for a simple yes or no question.
robin2 I did appreciate all your help as I stated that in every post, so again thank you