Show Posts
Pages: 1 2 [3] 4 5 6
31  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and Potentiometer positioning on: March 10, 2013, 09:45:40 am
here is the code
Code:
void Motor()
{
val1=analogRead(Poti1);
val2=analogRead(Poti2);
targetval1=(val1<(val1-10)||val1>(val1+10));
if ((val1>val2)&&(val1>minval))
{
Motor_1_3();
}
if ((val1<val2)&&(val1<maxval))
{
Motor_2_4();
}
if ((targetval1=val2)||(val1=minval)||(val1=maxval))
{
Motor_OFF();
}
}
32  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and Potentiometer positioning on: March 10, 2013, 04:55:26 am
still no use the same problem
33  Using Arduino / Motors, Mechanics, and Power / Re: L298N Motor Driver board on: March 10, 2013, 03:41:52 am
i have a similar board with L298N try to find out or your resistor capacitor diode are ok with a multimeter probably the diodes are damage
34  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and Potentiometer positioning on: March 10, 2013, 03:35:24 am
nothing my values wear 0 on both potentiometers
now have issue withe the deadband when i use
Code:
if (val1 < (targetval1-10) | val1 > (targetval1+10){
if ((val1>val2)&&(val1>minval))
{
Motor_1_3();
                         targetval1=val1
}
my code works one whey
35  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and Potentiometer positioning on: March 09, 2013, 12:05:19 pm
dude ur amazing i just looking for the deadband code
Code:
void Motor()
{
val1=analogRead(Poti1);
val2=analogRead(Poti2);
if ((val1>val2)&&(val1>minval))
{
Motor_1_3();
}
if ((val1<val2)&&(val1<maxval))
{
Motor_2_4();
}
if ((val1=val2)||(val1=minval)||(val1=maxval))
{
Motor_OFF();
}
}
one question can i put val = analogread to a different void or this wouldn't work
36  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and Potentiometer positioning on: March 09, 2013, 10:24:28 am
yes im trying to "modifying" this code for my purpose
37  Using Arduino / Motors, Mechanics, and Power / Re: Solenoid valve. on: March 09, 2013, 08:57:06 am
u can i there use a 12V solenoid valve or use a fuse for ur safty
38  Using Arduino / Motors, Mechanics, and Power / Re: Which controller for a 24V DC motor ? on: March 09, 2013, 08:10:21 am
this my help u http://www.robotpower.com/products/simple-h_info.html
or u can build it your self if u now how to use iron soldiering the question is how much Amps uneed
39  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and Potentiometer positioning on: March 09, 2013, 08:06:47 am
om trying to write some code but it dont work have no clue
Code:
void Motor()
{
val1=targetval1;
val2=targetval2;
if (targetval1!=targetval2)
{
Motor_ON();
{
if (targetval1<targetval2)
{
Motor_1_3();
}
if (targetval1>targetval2)
{
Motor_2_4();
}
}
}
if (targetval1=targetval2)
{
Motor_OFF();
}
}
im using now 2 potentiometer one its mechanically paired with dc motor and the other its for putting my values 
40  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and Potentiometer positioning on: March 08, 2013, 03:38:33 pm
value its form 0 to 1023 and if the serial.read input its lets see 500 then this while by my true value if the potentiometer "say so"
41  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and Potentiometer positioning on: March 08, 2013, 02:00:53 pm
 u help a little now i need to write this code but basic it should look like this arduino read a value from serial.read and then motor turn left or right till my value is true
42  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and Potentiometer positioning on: March 08, 2013, 10:56:46 am
1. yes it have 3600° turn so its 10 turn potentiometer
2. yes over a h-bridge controller
43  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and poti positioning on: March 08, 2013, 10:15:41 am
heh ok edited sorry for that it should be Precision potentiometer. 10 gears
44  Using Arduino / Motors, Mechanics, and Power / DC Motor and Potentiometer positioning on: March 08, 2013, 09:22:38 am
hey gays i want to make my dc motor to run with a Precision potentiometer. 10 gears left and right when the max or min position its achieved and from reading the serial the motor should position it self
have written some simple code but don't now how to do it further  (didn't make this yet) so heave some understanding and if your could help me further i did it appreciated
Code:
int Enable_A=13;
int Enable_B=8;
int Input_1=12;
int Input_2=11;
int Input_3=10;
int Input_4=9;
int Poti=A0;
int val;

void setup()
{
Serial.begin(115200);
Serial.println("REEDY");
pinMode(Enable_A,OUTPUT);
pinMode(Enable_B,OUTPUT);
pinMode(Input_1,OUTPUT);
pinMode(Input_2,OUTPUT);
pinMode(Input_3,OUTPUT);
pinMode(Input_4,OUTPUT);
}

void loop()
{
while(Serial.available() > 0)
{
char aChar = Serial.read();

if (aChar=='1')
{
Motor_ON();
Serial.print("Motor_ON and running 1_3 ");
Motor_1_3();
Motor_OFF();
}

if (aChar=='2')
{
Motor_ON();
Serial.print("Motor_ON and running 2_4 ");
Motor_2_4();
Motor_OFF();
}
if (aChar=='3')
{
Potie();
}
}
}

void Motor_ON()
{
digitalWrite(Enable_A,HIGH);
digitalWrite(Enable_B,HIGH);
}

void Motor_OFF()
{
delay(100);
digitalWrite(Enable_A,LOW);
digitalWrite(Enable_B,LOW);
Motor_Coast();
Serial.println("STOP");
}

void Motor_1_3()
{
digitalWrite(Input_1,HIGH);
digitalWrite(Input_2,LOW);
digitalWrite(Input_3,HIGH);
digitalWrite(Input_4,LOW);
}

void Motor_2_4()
{
digitalWrite(Input_1,LOW);
digitalWrite(Input_2,HIGH);
digitalWrite(Input_3,LOW);
digitalWrite(Input_4,HIGH);
}

void Motor_Coast()
{
digitalWrite(Input_1,LOW);
digitalWrite(Input_2,LOW);
digitalWrite(Input_3,LOW);
digitalWrite(Input_4,LOW);
Potie();
}

void Potie()
{
val=analogRead(Poti);
Serial.print("Poti = ");
Serial.println(val);
}
45  Using Arduino / Programming Questions / Re: mega and output voltage on: November 05, 2012, 02:00:36 pm
the voltage that i was measured was without  the led and relay that was "clean" output voltage without any consumer between GND and my output pin 23
Pages: 1 2 [3] 4 5 6