Show Posts
Pages: 1 ... 16 17 [18] 19 20 ... 147
256  Using Arduino / Motors, Mechanics, and Power / Re: Controlling Servo with Millis on: March 26, 2014, 12:14:58 am
Quote
I cant add a delay, I would like to keep the rest of the code running while the servo sweeps because the rest of the code contains leds that are time sensitive and are in sync with music. Is there any other way to control a servos position and speed without using delay?

Try it, just to see what happens.
You can take them out later or use mills() to replace them (see blink without delay examples).
257  Using Arduino / Motors, Mechanics, and Power / Re: DRV8834 DRIVER PROBLEM; STEPPER MOTOR ONLY BUZZES... on: March 26, 2014, 12:11:38 am
- Try a more substantial power supply as recommended already.
- What happens to the battery voltage humming?  Measure it with a voltmeter.
- At first glance try to increase the delay times to see what happens.
delayMicroseconds(1000);  // maybe try 10000 or 50000
- Are the motor wires connected correctly?
- Try reversing one of the coils.
258  Using Arduino / Sensors / Re: How to stop program as soon as sensor conditions met? on: March 25, 2014, 11:24:12 pm
Quote
we just had our 4th baby
If you are the dad, don't tell your wife how high the Arduino is in your priority  smiley-wink
Congratulations!
259  Using Arduino / Project Guidance / Re: Trigger an external interrupt using a piezoelectric vibration sensor on: March 25, 2014, 11:18:16 pm
Look at a comparator one-shot.
See the LM339 data sheet
260  Using Arduino / Programming Questions / Re: Editing Sketches and uploading without arduino software? on: March 25, 2014, 11:10:42 pm
Learn the Arduino C++
261  Using Arduino / Motors, Mechanics, and Power / Re: Controlling Servo with Millis on: March 25, 2014, 11:07:41 pm
Try:
unsigned long previousMillis = 0;

Do you mean:
unsigned long interval = 15000UL;

Put some delay in eg:
for(pos = 0; pos < 180; pos += 1)   
  {                                 
    myservo.write(pos);               
    delay(20);                     
  }
etc.

Use <Ctrl> T to format your code
262  Using Arduino / Motors, Mechanics, and Power / Re: Using magnetic contact switches with linear actuator on: March 25, 2014, 10:57:06 pm
Yes, do this.
 pinMode(sensorPin2, INPUT);
 digitalWrite(sensorPin2, HIGH);

Quote
I put the code in a for loop in the setup because I only wanted the code to run 15 times.
That is reasonable.
How are you telling it to cycle 15 times?
263  Using Arduino / Project Guidance / Re: Using the Digital Ouput to provide a ground signal on: March 25, 2014, 10:29:55 pm
Go ahead, buy one, play with it, write a sketch to flash one lamp with a MOSFET, add more lamps.
Have fun.
264  Using Arduino / Project Guidance / Re: Using several different pins? on: March 25, 2014, 08:49:18 pm
Sounds ok, what is this all about?
265  Using Arduino / Motors, Mechanics, and Power / Re: Motor fly back or something else? on: March 25, 2014, 08:02:13 pm
If you are reversing the voltage across the motor do not put a diode across the motor terminals.
Consider a MOV.
I see no reason that the motor power supply ground has to be connected to the Arduino ground "if it is".

Edit:
On second thought a MOV really should not be used in a constant transient condition like a motor.
266  Using Arduino / Programming Questions / Re: A delay problem on: March 25, 2014, 07:49:34 pm
Quote
This will stay in the memory banks
Better back it up.
267  Using Arduino / Programming Questions / Re: break code in loop on: March 25, 2014, 07:45:57 pm
You have a ; at the end of the for statement.
268  Using Arduino / Programming Questions / Re: break code in loop on: March 25, 2014, 07:12:00 pm
Use if, and a variable that starts out as 0, and which is incremented.
When the variable is < 3 the if statement is true and your statements will execute.
When the variable is => 3, your statements won't execute.

269  Using Arduino / Sensors / Re: Analog input problem on: March 25, 2014, 06:42:30 pm
You may have shorted some by accident.
Can you show us a good picture of the wiring?
270  Using Arduino / Motors, Mechanics, and Power / Re: Using magnetic contact switches with linear actuator on: March 25, 2014, 05:57:00 pm
You are not setting this pin in setup()
int sensorPin2 = 15;
You don't have much in loop() which is where the sketch runs over and over as opposed to setup() which only runs at reset (once).
Pages: 1 ... 16 17 [18] 19 20 ... 147