Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 225
61  Using Arduino / General Electronics / Re: Help on using relay with arduino on: February 16, 2014, 01:48:54 pm
So it seems the relay is ok?

Now try the circuit you have, but with the relay given 5V of its own, not from Arduino. (Remember to connect all the grounds)
62  Using Arduino / General Electronics / Re: Help on using relay with arduino on: February 16, 2014, 01:27:12 pm
Maybe the Arduino 5V can't supply enough current?

BTW, when you put 5V across the relay with no other electronics to complicate things, can you hear it switch?
63  Using Arduino / Programming Questions / Re: Servo Control with three buttons. (resolved and working!!!) on: February 16, 2014, 12:48:16 pm
I'm keen to see it in action
64  Using Arduino / Programming Questions / Re: Home controller system on web page on: February 16, 2014, 12:43:48 pm

Which mean? So overall my html is okay?

No it means your code is impossible to read... Use the code tag # above the  smiley-sweat so that

Code:
it
{
looks like
}
this
65  Using Arduino / Programming Questions / Re: Servo Control with three buttons. (resolved and working!!!) on: February 16, 2014, 12:35:32 pm
Slapping myself for just twigging to the fact that A being set high near the top of loop() isn't persistent through subsequent visits, while of course the armed variable is, until it's deliberately reset. Sorry PaulS, wildbill and Robin2....

Now I'm interested to hear how many doses of salt and pepper the OP is going to have to sell to recoup the cost of an Arduino, servo, coin machine and so on....
66  Using Arduino / Programming Questions / Re: Servo Control with three buttons. on: February 16, 2014, 12:14:42 pm
We did it, we did it!!! 

Excellent.

Quote
Here is the working code for those who are interested.

Um.... where?
67  Using Arduino / Programming Questions / Re: Servo Control with three buttons. on: February 16, 2014, 12:12:51 pm
No need for any delays. Re-read reply #15. PaulS gave you the necessary algorithm there.

And he's doing that already.

BUT, as soon as A is pressed it checks B right away. The OP doesn't want them to have to press them simultaneously, so if the user isn't infinetsimally quick on B, it'll read B as low.
68  Using Arduino / Programming Questions / Re: Servo Control with three buttons. on: February 16, 2014, 12:05:32 pm
You make any other changes at the same time? Maybe post the whole code again.

69  Using Arduino / Programming Questions / Re: Home controller system on web page on: February 16, 2014, 12:03:14 pm
Good example of why to use code tags.

Did you see it turned italic in the middle there? There's an array called command with elements called "i" and guess what?.... open square bracket followed by an i followed by a close square bracket is what turns italic on. So that few characters of your code has been interpreted rather than appearing on the screen.
70  Using Arduino / Programming Questions / Re: Servo Control with three buttons. on: February 16, 2014, 11:54:12 am
No that won't work, I think I mean (  smiley-cool ) between the lines where the buttons are actually read, so that after A is read it pauses and hopefully by the time the delay is over, the finger will be on B or C
71  Using Arduino / Programming Questions / Re: Servo Control with three buttons. on: February 16, 2014, 11:48:15 am

Perhaps you need a program that ignores BtnB and BtnC if BtnA has not been pressed. Then a press of BtnA is recorded in a variable and that allows BtnB or BtnC to be recognized.

That's basically what he has: B and C are only tested inside an if, when A's state is high.

I'm thinking his problem right now is a combination of no delays to give time to press B or C, and not resetting the states after the servo moves..... and maybe those extra {} pairs.
72  Using Arduino / Programming Questions / Re: Servo Control with three buttons. on: February 16, 2014, 11:40:08 am
Yeah sorry I agree, my interrupt idea is crazy....


Create a boolean variable, armed, initialized to false. Read the state of switch 1. If it is pressed, set armed to true.

Read the state of switches 2 and 3. If either is pressed and armed is true, move the servo, do whatever else needs to be done, AND set armed to false.

That's basically what he has, come to think of it. Button A's state of high, is armed, and he's checking B and C only inside the if A is high part anyway, so the thinking is good I reckon.

Just cheat and add a couple of delays for now, between the state checks, else button B will be false becasue the user was too slow. As I said earlier, remember to set them low once the move is done.

And you already have them set low at the beginning.

For real life you might want a coin return if the money is inserted but they change their mind. So have a button D that forces button A's state low when pressed, and cancels the transaction.

EDIT.... but take those extra {  } pairs out just in case
73  Using Arduino / Programming Questions / Re: Servo Control with three buttons. on: February 16, 2014, 11:17:48 am
Make the B and C buttons interrupts maybe?

(I can't help but wonder why we're going to have to pay for salt and pepper when most places have those annoying, but free, little packets  smiley-cool )
74  Using Arduino / Programming Questions / Re: Servo Control with three buttons. on: February 16, 2014, 11:08:10 am
Thanks... was just wondering they somehow might bundle some lines together. (In a way similar to the {} after an if, where without them, only the first xyz; gets recognised.)

75  Using Arduino / Project Guidance / Re: how to interface the rs232 to arduino uno on: February 16, 2014, 11:03:07 am
Well I guess AWOL has sorted it that there's only one thread now, and all the answers will be in the same place....
Pages: 1 ... 3 4 [5] 6 7 ... 225