Show Posts
Pages: 1 ... 45 46 [47] 48 49 ... 96
691  Using Arduino / Project Guidance / Re: beginner help on: January 21, 2014, 10:16:46 pm
The datasheet you referrenced doesn't show the current rating of the coil. I suspect that you'll need a separate 12V supply for the relay as the Arduino pins cannot supply enough voltage or current. Connect your arduino ground to the module's input pin 1 and your arduino output pin to the module's input pin 3. Connect the 12V ground to the module's input pin 1 and 12V +ve to the module's input pin 2.
That should get the relay switching on when you output a HIGH to the arduino's output pin.
692  Using Arduino / Project Guidance / Re: Auto leveling device - help requested. on: January 21, 2014, 09:54:24 pm
Yeah, ok.

I am wanting to get the servo motors to respond to tilting and "output" to level the platform.

I picked 3 servo motors rather than 2 (x/y) and make it a 3 point contact system.

Why? You only need 2 adjustments to level a tripod, the third leg can be a fixed height.
693  Using Arduino / Project Guidance / Re: Christmas light controller - Button Issue on: January 21, 2014, 09:42:11 pm
What Msquare said and use [ code] [ /code] tags when posting code.
See the hash button above the message input box.
694  Using Arduino / Project Guidance / Re: Automated liquor dispenser on: January 21, 2014, 09:35:11 pm
Forget about pumps. Use gravity and optics:
An accurately measured amount every time.
695  Using Arduino / Project Guidance / Re: dealing with wrapping numbers on: January 21, 2014, 09:22:49 pm
Hi guys,

I have a program for a garden watering reminder system. When it is really dry it goes into alarm mode to try and get my attention. All the LED's flash and every 5 minutes the piezo will chirp. I don't want it to chirp within a few hours after sunrise, or more than 3 hours after sunset. I don't want to use the time library because I don't want to set the clock every time there is an interruption to power.

So I take my lead from the 'Blink without delay' project to determine time since sunrise/sunset.

BUT!  millis() starts as soon as the board is powered up.  Being an unsigned long, it wraps to zero again after about 50 days.

At that point, isn't it possible that testing whether a counter integer is greater than the 3 hours interval since sunrise will falsely return that it is a smaller because millis() has wrapped to zero in the meantime?
That depends on how you wrote that piece of code.
if(millis() - startTime =>delayTime)
will not be affected by millis() rolling over after 50 days.
696  Using Arduino / Project Guidance / Re: Use TX and/or RX for SPST switch WHILE sending OUT data? - I've searched - sorry on: January 20, 2014, 11:03:38 pm
Can I be sending OUT MIDI data -
WHILE using --   Digital Pin 0 (RX)  AND/OR Digital Pin 1 (TX) as switch inputs?
Depends. Where is your MIDI being output? If on pin 0 or Pin 1, then no.
Also, if you're using the serial monitor the answer is no.
When you're loading a sketch, the switch will have to be disconnected.
697  Using Arduino / Project Guidance / Re: Detect angle between 2 devices on: January 20, 2014, 10:55:19 pm
Why not detect the strongest signal. Ultrasound from the human, ultrasound receiver on the robot. Turn the robot until the strongest signal received. It should then be (approx) facing the human. ADC the signal level from the receiver and compare the last reading with the current one to determine which direction to turn (obviously towards the stronger signal). When the readings either side of the current one are lower than the current one, your robot is facing the source of the ultrasound on the human. No angles involved.
698  Using Arduino / Programming Questions / Re: Obstacle avoiding robot, state machine code, help needed! on: January 18, 2014, 11:10:53 pm
I am attempting to set up the code for my obstacle avoiding robot, but I am running into some issues with it lagging between states.  The only part of my code that I think could cause this is the sensor reading, but I could be wrong.
    if (!moving) {
      startTurn = millis();
    else if (currentMillis - startTurn > 2000) {
      currentState = AVOID_TRAVELING;
If moving (the else part of the statement), where do you reset startTurn = millis()?
699  Using Arduino / Programming Questions / Re: Issues with how to code this. on: January 17, 2014, 10:53:39 pm
    if (time > lastpress + 1000){
That will cause problems when millis() rolls over.
Instead use:
if(time - lastpress > 1000){
700  Using Arduino / Programming Questions / Re: Help with code required on: January 17, 2014, 10:46:06 pm
Get rid of all your delay() calls. See 'blink without delay' example in the IDE. You might have a chance of your fade routine working then.
701  Using Arduino / Project Guidance / Re: Need some help coding on: January 17, 2014, 10:26:25 pm
sorry, here it is. just read the "red this before you post"...

  else {
    // turn LED off:
    digitalWrite(ledPin, LOW delay(2000) );
I think you mean:
digitalWrite(ledPin, LOW);
702  Using Arduino / Project Guidance / Re: Powering multiple devices on Arduino Mega on: January 17, 2014, 09:59:51 pm
Hey ,couple quick and most likely easy questions here, I'm definitely new at this-

I have an arduino mega and I'm trying to power multiple components at once (a PIR, buzzer, RTC) and I'm wondering the best way to do that... Since these are all low power can I just put them all in parallel on the 5V pin on the arduino?
What is the total power consumption of these?
One thing I was trying to do that wasn't working was to set a digital pin ( 8 ) to output and setting that to high to power the PIR... Why doesn't that work? Shouldn't it be getting  5V and working fine? When I use the 5V pin itself it works.
Output pins can only supply 40mA. The 5V pin can supply about 500mA
703  Using Arduino / Programming Questions / Re: Issues with how to code this. on: January 16, 2014, 10:06:35 pm
Use code tags to post code. See the # button above the input box
As it is, it's impossible to edit your code.
704  Using Arduino / Programming Questions / Re: error with using function millis() on: January 16, 2014, 09:57:56 pm
You're not resetting starttime = millis() in your loop(), so the while condition will always be false after the first itteration.

705  Using Arduino / Project Guidance / Re: My first project. In need of some assistance on: January 16, 2014, 09:47:39 pm
First look at the 'blink without delay' sketch in the IDE. <File:Examples:02Digital:BlinkWithoutDelay>
Once you understand that you can look into varying the timing with a pot.
Pages: 1 ... 45 46 [47] 48 49 ... 96