Show Posts
|
|
Pages: 1 [2] 3 4 ... 26
|
|
16
|
Using Arduino / Programming Questions / Re: New to Arduino
|
on: February 12, 2013, 05:18:44 am
|
int timer = 1000; int i = 1;
void setup() { for (int thisPin1 = 1; thisPin1 < 13; thisPin1++) for (int thisPin2 = 13; thisPin2 < 25; thisPin2++) for (int thisPin3 = 24; thisPin3 < 38; thisPin3++) for (int thisPin4 = 37; thisPin4 < 43; thisPin4++) { pinMode(thisPin1, OUTPUT); pinMode(thisPin2, OUTPUT); pinMode(thisPin3, OUTPUT); pinMode(thisPin4, OUTPUT); pinMode(51, OUTPUT); pinMode(52, OUTPUT); pinMode(53, OUTPUT); } }
void loop() { while (i<2) { i++; { for (int thisPin1 = 1; thisPin1 < 13; thisPin1++) for (int thisPin2 = 13; thisPin2 < 25; thisPin2++) for (int thisPin3 = 24; thisPin3 < 38; thisPin3++) for (int thisPin4 = 37; thisPin4 < 43; thisPin4++) { digitalWrite(52, HIGH); delay(3000); digitalWrite(52, LOW);
digitalWrite(thisPin1, HIGH); digitalWrite(53, HIGH); delay(100); digitalWrite(53, LOW); delay(timer); digitalWrite(thisPin1, LOW);
digitalWrite(thisPin2, HIGH); digitalWrite(53, HIGH); delay(100); digitalWrite(53, LOW); delay(timer); digitalWrite(thisPin2, LOW);
digitalWrite(thisPin3, HIGH); digitalWrite(53, HIGH); delay(100); digitalWrite(53, LOW); delay(timer); digitalWrite(thisPin3, LOW);
digitalWrite(thisPin4, HIGH); digitalWrite(53, HIGH); delay(100); digitalWrite(53, LOW); delay(timer); digitalWrite(thisPin4, LOW); } } } }
|
|
|
|
|
18
|
Using Arduino / Programming Questions / Re: New to Arduino
|
on: February 12, 2013, 05:10:08 am
|
post your code with using the code tag function ok btw your code, you are using all your pin in maybe a mega i think you just use ; in what should be , int timer = 1000; int i = 1;
void setup() { for (int thisPin1 = 1; thisPin1 < 13; thisPin1++) for (int thisPin2 = 13; thisPin2 < 25; thisPin2++) for (int thisPin3 = 24; thisPin3 < 38; thisPin3++) for (int thisPin4 = 37; thisPin4 < 43; thisPin4++) { pinMode(thisPin1, OUTPUT); pinMode(thisPin2, OUTPUT); pinMode(thisPin3, OUTPUT); pinMode(thisPin4, OUTPUT); pinMode(51, OUTPUT); pinMode(52, OUTPUT); pinMode(53, OUTPUT); }}
void loop() { while (i<2) {i++; { for (int thisPin1 = 1; thisPin1 < 13; thisPin1++) for (int thisPin2 = 13; thisPin2 < 25; thisPin2++) for (int thisPin3 = 24; thisPin3 < 38; thisPin3++) for (int thisPin4 = 37; thisPin4 < 43; thisPin4++) { digitalWrite(52, HIGH); delay(3000); digitalWrite(52, LOW); digitalWrite(thisPin1, HIGH); digitalWrite(53, HIGH); delay(100); digitalWrite(53, LOW); delay(timer); digitalWrite(thisPin1, LOW); digitalWrite(thisPin2, HIGH); digitalWrite(53, HIGH); delay(100); digitalWrite(53, LOW); delay(timer); digitalWrite(thisPin2, LOW);
digitalWrite(thisPin3, HIGH); digitalWrite(53, HIGH); delay(100); digitalWrite(53, LOW); delay(timer); digitalWrite(thisPin3, LOW);
digitalWrite(thisPin4, HIGH); digitalWrite(53, HIGH); delay(100); digitalWrite(53, LOW); delay(timer); digitalWrite(thisPin4, LOW); }}}}
|
|
|
|
|
19
|
Using Arduino / Motors, Mechanics, and Power / Re: Proximity Sensor and 5 solenoids
|
on: February 12, 2013, 04:56:26 am
|
|
actually DDRYA, though picture speak a thousand word, for the life of me i cant actually see what type of transistor ur using, whether the yellow wire on top is the positive or the negative side of the circuit. however about our question, usually when you are powering a project and want to switch on and of a solenoid it is always better that you make the connection parallel.So in that sense you could use a 12Vdc power supply but 14Vdc would be a better choice since there would be a drop in the transistor, however i would also warn you that the arduino have an absolute max Vdc input of 12Vdc. So my suggestion to you is that, if you are willing to use 2 power supply then, 1 7Vdc power supply for your arduino and 1 14Vdc power supply for your solenoid. or use a single 12Vdc power supply, is good for both.
|
|
|
|
|
21
|
Using Arduino / Project Guidance / Re: RC servo control
|
on: February 08, 2013, 09:10:57 am
|
|
Simplest way is to impliment delay. But for a more profesional looking code use what the technique shown on blink without delay. How abou u post yourcode for us to really help you
|
|
|
|
|
24
|
Using Arduino / Motors, Mechanics, and Power / Re: Controlling DC voltage to a linear actuator
|
on: February 07, 2013, 02:23:22 am
|
|
What is speed? As i recall from my physic class when i was 14, speed is displacement over time So i think if you can control how far the linear motor move within a given time , you have speed control? Correct me if 'm wrong guys.
You need some kind of feedback to know control the speed, usually people will use incremental encorder, rarely people will use absolute encorder , and since you are using a linear motor one more option if shaft is short you could also use a linear/log pot.
So this is how i would tackle this problem, it is not nececerily the best or the most elegent way of doing it but its how i think could be one of the way of doing it....
Since ve have some form of feedback you could make use of a simple calculation to set the speed One you need to define the length of travel and the time it would take for the motor to reach that length. W
|
|
|
|
|
30
|
Using Arduino / Motors, Mechanics, and Power / Re: Controlling position of linear actuator
|
on: February 05, 2013, 11:39:33 am
|
hello Retroplayer i guess this would not be a good idea but if your willing to try, Each h-bridge has a forward and reverse signal, btw. 10 is forward, 01 is reverse, 00 is off, and 11 is a no-no (no braking.)
if you do decide to use pwm to control the speed your set up one way to do it is by controlling one of the pin for example if you want to go forward, you have to pwm the first pin. for braking, you could for instant if you go forward pwm the second pin but use only 50 that way you have total braking.
|
|
|
|
|