Loading...
  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
Code:
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);
            }
    }
  }
}
17  Using Arduino / Programming Questions / Re: New to Arduino on: February 12, 2013, 05:17:56 am
i gave you the edited version ....
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 ,
Code:
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.
20  Using Arduino / Motors, Mechanics, and Power / Re: Servo Motor Position Control with potentiometer on: February 08, 2013, 06:53:54 pm
Then its better to use an encorder. But 1 work around that i could think of if he turn thr pot to 0 if every time he what to move the servo
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
22  Using Arduino / Motors, Mechanics, and Power / Re: Latte Printer on: February 07, 2013, 02:30:42 am
I second what robtillaart said. But to answer your question about how to trick the paper sensor, just block the perticular photointeruptor the detect the paper...
23  Using Arduino / Motors, Mechanics, and Power / Re: Controlling DC voltage to a linear actuator on: February 07, 2013, 02:27:58 am
And using the formula of displacement over time you will get the speed.
Now what you should do is to base on your feedback of your choice, you should know how many tick of an incremental encorder, or the final value of the absolute encorder or linear pot.
 
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
25  Using Arduino / Motors, Mechanics, and Power / Re: Controlling a DC motor using PWM and a potentiometer on: February 06, 2013, 10:04:29 pm
Code:
int speedread=analogRead(pot1);
 Int speed=map(speedread,0,1023,90,255);
 AnalogWrite(motor1,speed);

This way you could use the full renge of the pot and have the motor start moving as your intended speed....
This is not a complete code so add the thing
26  Using Arduino / Motors, Mechanics, and Power / Re: Controlling a DC motor using PWM and a potentiometer on: February 06, 2013, 09:49:42 pm
Hi, i'm.sorry if i.have so many typ, i typing using a phone.
I would recommend you to use the map function

27  Using Arduino / Project Guidance / Re: How do you adjust PWM periods for Servo control? on: February 06, 2013, 10:21:35 am
Usually people would use the servo library.
Since it is a class you can actually asign as many as you want under the limit of each bord capability.
28  Using Arduino / Motors, Mechanics, and Power / Re: Controlling position of linear actuator on: February 05, 2013, 01:36:08 pm
well it seem that you understand what i mean..... btw what do you mean by no no
29  Community / Gigs and Collaborations / Re: Project Completion Help on: February 05, 2013, 12:38:23 pm
indiegogo or kickstater? search for crowd funding
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,
Quote
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.
Pages: 1 [2] 3 4 ... 26