Show Posts
Pages: 1 ... 35 36 [37] 38 39 ... 267
541  Using Arduino / Programming Questions / Re: How do I add additional sensors? on: June 01, 2014, 01:45:40 pm
How many different sensorPins have you got?

And how many different sensorPinValues?
542  Using Arduino / Programming Questions / Re: Problem millis() 3 LEDs +dist sensor on: June 01, 2014, 11:35:26 am
Mind you, I live at 1800m 6000' ASL so water boils a bit colder up here, may need a bit more time to cook.
543  Using Arduino / Programming Questions / Re: Problem millis() 3 LEDs +dist sensor on: June 01, 2014, 11:18:52 am
Or, to put Paul's cooking class back into the led world  smiley-cool, each time through loop() you need to see if it's time to turn the led off. You store the time from millis() when you turn the led on, and so each time through loop() you see if the new time from millis() minus that old stored time is equal to or greater than how long the led should be on for.

You might find this video to be useful.

BTW, 3 minutes is waaaaay to short for a boiled egg Paul....
544  Using Arduino / General Electronics / Re: problem in getting the desired output on: June 01, 2014, 07:35:11 am
the resistor that i connected is a pull up resistor. value 10k ohms.

I think you may the switch wired wrong: looks to me like 5V is connected to GND permanently through the resistor and you're not  pulling the i/o pin to 5V.

Please do all of us- including yourself- a favour, and lose the external resistor. Use the INPUT_PULLUP approach and then just simply pull the i/o pin to ground through the switch as I suggested earlier, like this
545  Using Arduino / General Electronics / Re: problem in getting the desired output on: June 01, 2014, 07:28:53 am
In addition to Mike's excellent guide... I have a write-up with videos that show what's happening, on an oscilloscope.

http://www.baldengineer.com/tutorials/arduino-pull-ups/

Nice video James...

Maybe worth pointing out that the video shows the "old" way of using the internal pullup, by setting an input pin high:

Code:
pinMode(myPin, INPUT);
digitalWrite(myPin, HIGH);

The later IDE supports a simpler one line "new" way of doing this:

Code:
pinMode(myPin, INPUT_PULLUP);

546  Using Arduino / General Electronics / Re: SCR vs saturated transistor as switch on: June 01, 2014, 05:24:29 am
Thanks guys
547  Using Arduino / General Electronics / Re: problem in getting the desired output on: June 01, 2014, 05:06:29 am
Tip - wire push buttons like this across a diagonal, then you always get the right two pins.

That IS a good tip... they always confuse me.

The diagram attached shows how those 4-pin switches work  internally so you can see what Mike says makes sense. Pins on a diagonal are always across the switch; pins on one side might or might not be. Awesome tip....
548  Using Arduino / General Electronics / Re: SCR vs saturated transistor as switch on: June 01, 2014, 04:41:51 am
Does it matter where the load goes?- like the way it matters on an NPN transistor where the load is above the collector.
549  Using Arduino / General Electronics / Re: problem in getting the desired output on: June 01, 2014, 04:25:40 am
It's very difficult (ie impossible) to figure out your circuit from those pics- can you do a sketch of the circuit and post a photo of it for us?

But as far as I can see, you don't have a pullup resistor: you have a resistor in series with the switch and the pin. I'm not sure though, from the pix.

That said, it's MUCH easier to use the internal pullup, and have the pin high normally and to ground when pressed.

But if you post a pic of a circuit schematic, we'll see more clearly.

You should be aiming for this
550  Using Arduino / Programming Questions / Re: One LED brighter than other? on: May 31, 2014, 01:46:23 pm
You have pin 4 as an INPUT....
551  Using Arduino / General Electronics / Re: problem in getting the desired output on: May 31, 2014, 12:32:46 pm
Your hand is making the pin pick up stray sugnals. Read about pinMode(x, INPUT_PULLUP) here.

Use that approach and change the wiring (which you didn't show) so that the switch connects the pin to ground not 5V. The pin will normally be high (via the pullup) and go low when you push it. Change the code to reflect that pushed is low and un-pushed is high.
552  Using Arduino / Project Guidance / Re: Help: Servo vs Stepper on: May 31, 2014, 12:15:08 pm
Not strictly true to say that steppers or dc motors need driver boards, since either of those can be driven by discrete components. But from a practical POV, yep a board (or a shield) is easiest. A shield btw is a board designed to plug in on top of an Arduino so the connection is much easier than a standalone board which will need wires.

Here's a tutorial for a dc motor, and this one is for a stepper.

Servos just connect as shown in the attached pic.
553  Using Arduino / Project Guidance / Re: Relay with physical switch on: May 31, 2014, 11:41:22 am
Quote
But if you want to only turn OFF with the phone if the original switch it's already ON you can put the original switch and the relay in series

And next night? When you enter the room the light switch is still "on" but the light is "off", so to "on" the light you need to "on " the relay. Then the OP's back where he started, with only the relay doing the switching.

With the way I proposed, next night on the way into the room he switches the light on by flipping the light switch, and the light goes off regardless of the fact the relay is still in the position it was left in last night. But of course this way requires  SPDT switch and relay, and double wiring in the wall.

Simple series switch and relay will not, I think, meet the OP's needs.

554  Using Arduino / Programming Questions / Re: How to make arduino email me when my public IP changes? on: May 31, 2014, 11:30:44 am
Seems to me that if the router's ip addy changes, then the Arduino which is on the lan side is isolated from the world to which you want it to send an email that the ip changed, by the very fact that the ip has changed.

I went for dyndns- get an address from them. Then in my router setup, I entered that name in the appropriate menus (dyndns happens to be a service that my router supports). When the router sees that its ip has changed, it alerts dyndns who then map the name to the new addy. So from outside, you always use the same name; behind the scenes the ip changes but that's invisible.
555  Using Arduino / Programming Questions / Re: Is code aware of the sketch name? on: May 31, 2014, 08:27:12 am
Why don't you save a modified copy of the library and call the original from one sketch, and the modded one from the other?
Pages: 1 ... 35 36 [37] 38 39 ... 267