Show Posts
Pages: 1 ... 24 25 [26] 27 28 ... 109
376  Using Arduino / Project Guidance / Re: Help with sampling using analog port (noise from finger) on: May 28, 2014, 09:10:19 pm
Don't try soldering it to your finger as it will hurt a lot and not work  smiley-grin
Good practical advice there. Do you work for the Health and Safety Executive?   smiley
377  Using Arduino / Project Guidance / Re: Changing the program on: May 28, 2014, 09:01:39 pm
I have a robot that uses arduino programming but the programs that I know how to write don't work with the robot. I think that the programs only work for a particular electric motor.

I would like to know if I can make a program for a particular electric motor and how can I do so?

Hope you can help.
My crystal ball has crashed, so I can't see your code. You could try posting it here (using code tags, the # above the smileys) so that we can all see it and maybe, help. On the other hand, we could just make stupid guesses that won't help at all and waste both your and our time.
378  Using Arduino / Project Guidance / Re: Just Getting Started on: May 28, 2014, 08:53:08 pm
Does the sketch verify (you don't need the Arduino plugged in for this)? If not, you've probably not downloaded the correct IDE or the download failed in some way. Try downloading it again.
If it does verify, then you've probably not set up the correct Com port and/or board type in the IDE.
379  Topics / Product Design / Re: Designing shields on: May 27, 2014, 11:40:19 pm
So why not make a shield with male pins, and use jumper wires to select what's connected to what?
No soldering needed then.
Does take up more room tho.
Thanks for that suggestion, XRoads. I'll see if I've enough space to fit them on.
380  Using Arduino / Programming Questions / Re: checking for the status of a pin on: May 27, 2014, 11:23:21 pm
Hi,

How does one check the status (HIGH LOW) of a pin and use the result.

thanks  steve
How about using a variable to keep track of the pin's state?
Whenever you change the pin's state, also change the variable.
381  Using Arduino / Programming Questions / Re: Any ideas on how to play audio while concurrently updating an LCD? on: May 27, 2014, 10:59:36 pm
... you are doing something less than optimal (otherwise known as wrong).
Less than optimal == wrong.
Far less than optimal == very wrong.
Non-optimal == damn stupid.  smiley
382  Using Arduino / Programming Questions / Re: the best way on: May 27, 2014, 10:51:54 pm
hello everybody,
in your opinion what is the best way for write a program that at the same time, when I press, and keep pressed, the button 5 the led is off till I take off my finger and, independently at what is the state of button 5, when I press the ''switch'' ( button 4 ) the led turn off until I press again the same button?
thanks to all
Andrea Fipilli
Why are you using a 220 Ohm pull-down resistor on one of your switches? Both should be around 10K.
For your program, write an ordered list of all the conditions it can be in. That will get it clear in your mind and you will be able to describe to us exactly what you want it to do.
383  Using Arduino / Programming Questions / Re: Trigger a loop on: May 27, 2014, 10:33:54 pm
You've not told us, nor defined in your sketch, what pin this trigger is connected to.
Let's assume it's on pin 9, you've defined it as an input and you have a pull-down resistor also on pin 9.
Code:
int trigger =9;  //or #DEFINE trigger 9
pinMode(trigger, INPUT);
Then simply look to see if the button is pressed each time round loop()
Code:
void loop(){
if (digitalRead(trigger)==HIGH){  //is button pressed? Yes, then
//do rest of your code
 //otherwise go directly here (do not pass Go, do not collect £200)
}  //End of if()
} //End of loop()
In cases where the button could be read multiple times you would need to debounce the button, but as your loop takes around three minutes to complete, this won't be necessary. You can't read the button whilst the delays() are being run, but you will be able to, once they've finished. This appears to be what you want.
NB 1) By convention, variables are all lower case or 'camelCase'.
2) When posting code to the forum, please use code tags (the # button above the smileys)
384  Using Arduino / Programming Questions / Re: Take out switch and make my own, High and Low Code. on: May 27, 2014, 09:57:56 pm
Where have you defined buttonpin as an input or output? It can't be both!
I'd not use pin 0 as that is used by the USB input during uploading of a sketch and for serial input and output.
Do you have a pull-up or pull-down resistor on your buttonpin?
What, exactly, are you trying to do?
385  Using Arduino / Project Guidance / Re: Model Rail Speed on: May 27, 2014, 09:33:30 pm
It's curious. Given that the DCC protocol (apparently, based on comments here) passes the requested speed to the engine, and the engine (presumably, on those systems that would support Railcom) has speed sensing capability, wouldn't it have made more sense to put the closed loop speed control inside the engine? If DCC actually provides a 'power demand' rather than a 'speed demand' then this would explain why direct speed control isn't currently possible; it would IMO make more sense to repurpose the signal to be a speed demand and just make the engine a little bit smarter. Given the amount of time and effort people put into these installations it strikes me as strange that this hasn't already been done and adopted as a standard, and I can't help thinking that somebody somewhere must have already solved this problem.
The problem is that there's no generic internal way to measure the speed, as the gearing and wheel size for each locomotive is different and some have 5 or 7 pole motors, although most have 3 pole motors. There is a way of measuring the speed of the motor[1] on traditional 12V layouts, by counting the fly-back pulses from the commutator.  Even using this method, you can't have more than one loco running at a time, as the pulses will interfere with each other. With DCC, these fly-back pulses are supressed for obvious reasons.

[1] By calculating the number of motor poles, gear ratio, wheel diameter and scale, you can get an approximation of scale speed. This,  of course, assumes no slipping or wheel spin. It's more accurate in larger scales (Gauge 0 and above) where the weight of the loco gives better adhesion and less slippage, the accuracy of the wheel diameter measurement is less critical and the scale factor less likely to multiply up any errors.

This method, if I remember correctly, was from a project by MERG in the late 1960s, when I was a member.
386  Using Arduino / Project Guidance / Re: Ball valves - H Bridge fake proportioning on: May 27, 2014, 06:16:24 pm
...is there a way to do this

If requestedpos => currentpos ,

else if requestedpos =< currentpos ,

requestedpos = currentpos;

 Pesh
Yes, you've almost done it, except for the first line: If requestedpos == currentpos , do nothing, it's already there!  and the logic to tell the valve which way to move and for how long/far.
387  Community / Bar Sport / Re: What Faggot means in the UK on: May 26, 2014, 11:59:47 pm
Hi, yes things are bigger in Australia.
http://en.wikipedia.org/wiki/Wagon_Wheels
Including wagon wheels.

Tom..... smiley
Maybe yours are a larger diameter, but ours are thicker...by 4mm!
But, I'm told that size doesn't matter.   smiley-wink
388  Community / Bar Sport / Re: time for a new Arduino Quantum ? (quantum computing with google) on: May 26, 2014, 11:44:46 pm
time for a new Arduino Quantum ?

- http://qcplayground.withgoogle.com/#/home -
My (very basic) understanding of QM tells me that, if I try to measure it, it won't be there and if I find out where it is, I won't be able to measure it. Therefore,:
1) How will I know if I've enough space on my desk to fit a quantum computer?
2) Do I need to buy one, or will one just pop into existence in my study? ("Honestly, Officer, that's how I got it!")
 smiley-grin smiley-grin smiley-grin smiley-grin
389  Community / Bar Sport / Re: The beginners dilemma on: May 26, 2014, 11:25:08 pm
Hi, my step daughter (now 25yo) came out of primary school (years 0 to 6) and still did not know what clockwise and anti-clockwise WAS!!! (Digital time taught)
My father taught me "Turn to the right to make it tight." That works...until you find a left-handed thread!
Quote
Also she would take time to even work out  6 times 7, then when asked immediately after it,  7 times 6, she would take time and work it out AGAIN!!!! (They never had to memorise multiplication tables or anything,)
They're taught to rely on calculators, but if they miss-key, or use the wrong formula, they'll never know they've got the wrong answer!
Earlier today I wanted to convert US$42 into pounds Sterling. I know that $1 is approx. £0.65. Being lazy, I fired up the calculator and entered 42/0.65. Woops. That can't be right! Face-palm! I meant 42 * 0.65.  Would any one who had not been taught basic arithmatic have spotted that or would they have assumed the first answer was correct?
390  Topics / Product Design / Re: Designing shields on: May 26, 2014, 09:22:19 pm
Then there are those who cannot or will not solder.
Yes, but it's not a particularly difficult skill to acquire.
Quote
No matter what, it just won't be universal enough.
Agreed, but some versatility is better than none.
Quote
It'll always be something.
Yes, but why not mitigate where we can?
Quote
> > > I've modified shields, too
So have I.   smiley-mad smiley-mad
Pages: 1 ... 24 25 [26] 27 28 ... 109