Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #15 on: July 19, 2012, 09:35:55 pm » |
ohh, well is that how my switch workss?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #16 on: July 19, 2012, 11:04:22 pm » |
i want the program on the arduino to say, when positiion 1 on the switch gets a signal in whatever pin it goes in on the arduino to make the delay this many milliseconds and so on. does anyone know what pins should be used for the switch i got?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6553
Arduino rocks
|
 |
« Reply #17 on: July 20, 2012, 12:14:01 am » |
Two servo test code that can be modified to position a single servo in several different positions depending on the switch position. //zoomkat servo button test 12-29-2011
#include <Servo.h> int button1 = 4; //button pin, connect to ground to move servo int press1 = 0; int button2 = 5; //button pin, connect to ground to move servo int press2 = 0; Servo servo1;
void setup() { pinMode(button1, INPUT); pinMode(button2, INPUT); servo1.attach(7); digitalWrite(4, HIGH); //enable pullups to make pin high digitalWrite(5, HIGH); //enable pullups to make pin high }
void loop() { press1 = digitalRead(button1); if (press1 == LOW) { servo1.write(170); } press2 = digitalRead(button2); if (press2 == LOW) { servo1.write(10); } /*else { servo1.write(90); }*/ }
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #18 on: July 20, 2012, 12:29:14 am » |
that wouldn't adjust the delay for each switch postion would it? or i would have to chanfe it to do that?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #19 on: August 06, 2012, 08:33:21 pm » |
would a video explaining help? im a beginner so if you guys already put it in black and white please show me. i have no idea where to start, im not impatient its just people are annoying me to finish it, so id like toget it done soon. thanks
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6553
Arduino rocks
|
 |
« Reply #20 on: August 06, 2012, 08:48:40 pm » |
i have no idea where to start, im not impatient its just people are annoying me to finish it, so id like toget it done soon. thanks Sounds like a school assignment. So what have you tried on your own since your last post on July 19?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #21 on: August 07, 2012, 12:09:59 pm » |
i tried to see if i could find anything like a diagram or somthing on google showing how to connect the switch to the arduino but i couldnt find anything. i also looked to see if anyone did Anything similar to what im doing but i couldnt find anything i also made this video a few day ago scince i dont have my gopro at the moment. i know it can be a whole lot better. but thats just the way i am with everything. its also ok for my first video like that.
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6391
-
|
 |
« Reply #22 on: August 07, 2012, 06:37:30 pm » |
i also made this video a few day ago scince i dont have my gopro at the moment.
What the bleep has that video got to do with your question?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6553
Arduino rocks
|
 |
« Reply #23 on: August 07, 2012, 07:57:05 pm » |
i also made this video a few day ago scince i dont have my gopro at the moment.
What the bleep has that video got to do with your question? It is what you do while waiting for somebody to do your homework for you. 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #24 on: August 07, 2012, 09:00:03 pm » |
lol, no i made that video the other day because the camera im making this wiper for is getting fixed. and it not my home work, my dad is nagging my to make it and all these people want me to make them it. they think i can just turn it out. like no i have no idea where to start i used a code that came with the program. this is the camera i use the wiper on. its a gopro you can see the wiper go like every 8 or 10 seconds i forget what i set it too if you think a video would help ill make one. and im only 16 so i wouldnt have a class that would expect me to build somthing like this and it is summer.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #25 on: August 08, 2012, 08:26:28 pm » |
Two servo test code that can be modified to position a single servo in several different positions depending on the switch position. //zoomkat servo button test 12-29-2011
#include <Servo.h> int button1 = 4; //button pin, connect to ground to move servo int press1 = 0; int button2 = 5; //button pin, connect to ground to move servo int press2 = 0; Servo servo1;
void setup() { pinMode(button1, INPUT); pinMode(button2, INPUT); servo1.attach(7); digitalWrite(4, HIGH); //enable pullups to make pin high digitalWrite(5, HIGH); //enable pullups to make pin high }
void loop() { press1 = digitalRead(button1); if (press1 == LOW) { servo1.write(170); } press2 = digitalRead(button2); if (press2 == LOW) { servo1.write(10); } /*else { servo1.write(90); }*/ }
im pretty sure this would work its just i dont know how and where to insert it into my code to make it not change the position of the servo but change the delays and what pins on the arduino to connect the the pins on the switch also can i just solder the servo positive to the positive on the switch to one pin and put that pin in the 5v on the arduino or would i need to get one of those breadboards that are like white plastic
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #26 on: January 11, 2013, 06:40:00 pm » |
i made this video a while back then just stopped caring about gettingthe wiper done because race season was over, but now its possible we are going to have a race in mid febuary so i figured i would get it done now, i hope this clearly explains my question http://www.youtube.com/watch?v=2IrCplYeUZw&feature=youtu.bei know i sound like a dweeb, i was sick.
|
|
|
|
|
Logged
|
|
|
|
|
|