Show Posts
Pages: 1 ... 88 89 [90] 91 92 ... 269
1336  Using Arduino / Programming Questions / Re: Button Motor Control Issues on: January 05, 2014, 03:01:08 am
Yeah as Larry just posted, we's need to see the wiring.

Ok you posted in the meantime that you have pullUPs?- if so the pin will be high until you press the button...  Post your wiring...

I see you have a Serial.print for button 1.... what does it say? Because if you have the wiring such that button1 is high even when it's not pressed, then that would explain why it's working thru the code like it is.


Suggestion: put Serial.prints inside each leg of the "if", that way you'll see where the flow is going.

Code:
if (buttonState1 == HIGH) {
    Serial.println("I'm in the button 1 high leg.....");     //<<<<<<<<<<<<<<<<<<, new
     analogWrite(motorPin,  220);
       delay(delaytime/5);

//

else if (buttonState2 == HIGH) {
      Serial.println("I'm in the button 2 high leg.....");     //<<<<<<<<<<<<<<<<<<, new
     analogWrite(motorPin,  220);
       delay(delaytime/5);
     analogWrite(motorPin,  100
1337  Using Arduino / Project Guidance / Re: Arduino serial monitor to write posts that can not be understood on: January 05, 2014, 02:48:37 am
Quote
Set your Serial monitor to 57600 baud

And please, please, don't ask your question in mile high neon red letters.
1338  Using Arduino / Programming Questions / Re: Debounce toggle. Another stupid noob code question. on: January 05, 2014, 02:44:29 am
Quote
the idea of programming code might as well be written in a lost language.

I have held the view for decades, that teaching of programming languages often gets it back asswards. When I learned Fortran exactly 40 years ago when I was a 1st year student here in 1974, we started with flowcharts. Get down on paper exactly what it is you want to do. Later when I learned Cobol, they used structure charts- different from flowcharts, but same idea: get your mind round what it is you're trying to do before you think of the code. Only once the thoughts are clear, do you hit the code.

Coding without a design is like building a house with no plans.... you might get to the roof and think shit, if we make the roof out of these heavy slates the whole thing's going to collapse. Never mind, we'll just unbuild the last week's work and make stronger trusses.

The coding is relatively straight forward once you have the plan in place.....

I think nowadays, the teaching goes into the syntax and rules and grammar and crap too early: fine if you're a seasoned user of another language, and know about the thought process.

1339  Using Arduino / General Electronics / Re: Determining if my Arduino is running from USB or Mains AC power on: January 05, 2014, 02:23:11 am
Let's hope you never actually run from mains AC power though.....  smiley-cool

Quote
My power supply is 12V 2.5 Amps instead of 12V 0.5Amps

Since things only draw the current they need, using a 2.5A supply rather than 0.5A, just means you spent more money than necessary and have one that's over spec'd.

A while ago I coudn't find a supply to test a 12V computer fan, so I opened the car bonnet (or hood, depending where you live) and stuck the wires on the battery. Fan needs under an amp, a car battery can supply two orders of magnitude more than that. No harm done....
1340  Community / Bar Sport / Re: karma is biased. on: January 05, 2014, 02:16:53 am
I was pondering the posts/karma thing too, and specifically calculated that for who I assume the curmudgeon to be. His posts / karma is about 90, mine's 60 so in a sense my karma is "better" than his.

BUT.... I thought further, seeing as it was pointed out above that he sticks with a poster's problem till the bitter end once he gets his teeth in. So then his posts / karma will rise, and look "bad" since it might cost him 20 posts to help the poster yet still result in only 1 karma point.

So frankly, other than just as a bit of fun and a talking point on a boring Sunday morning, the karma thing is really just a wank.
1341  Using Arduino / Programming Questions / Re: Debounce toggle. Another stupid noob code question. on: January 05, 2014, 02:10:22 am
Quote
(I'll give you a hint, it's printing lingo)

Thank you, but no hint needed, I know what those are. And although they have a printing connotation, they are at the end of the day, just more units of measure.. I'm an engineer, and units of measure are things that engineers deal with all the time, including conversion between systems. So as long as I can look up somewhere that there are X Y's in a Z, (eg 72 points in an inch) then I can quite happily convert between Ys and Zs or Zs and Ys. No magic there.

Now, if I didn't know how to measure in the first place, perhaps having no concept of quantity of length, that would be a different discussion.
1342  Using Arduino / Programming Questions / Re: Debounce toggle. Another stupid noob code question. on: January 05, 2014, 01:30:41 am
Quote
Being smart doesn't mean I know everything

True, but being smart should mean you aren't a dummy. I think that's the point cjd was making.
1343  Community / Bar Sport / Re: After two weeks out of the office.... on: January 04, 2014, 11:55:13 pm
Hungry.... I am now in the mood for a curried mince vetkoek or maybe a bunny chow.
1344  Community / Website and Forum / Search for member by name on: January 04, 2014, 11:12:16 pm
G'day forum peeps,

Prior to the site upgrade there was a link to search for members. I can't find it now.

Code:
If (member search is still available) {
can someone tell me where it is please
}
else {
can the webmaster please put it back
}
1345  Using Arduino / Programming Questions / Re: if statement with sensors and timing on: January 04, 2014, 10:15:17 pm
I'm not very clued up on this, but isn't this project a prime candidate for a state machine approach, for which there is a library in the playground.

Search the forum too- there have been loads of posts concerning this lately.

1346  Using Arduino / Sensors / Re: Hall Effect Sensors on: January 04, 2014, 11:29:26 am
Linear are analog: powered up, the one I was looking at gives 0.5 of the input voltage as output,. The output goes up or down to supply volts or down to 0, with the presence of a S or N field.

I found my sensor wasn't reliable for speed measurements, wasn't "digital enough".... Only later did I read the data sheet. That was an Allegro 1302.

By contrast, the Allegro 110x are switches, and are active in the presence of a S pole.

Then there's the Diodes Inc AH180 which is also a switch, but not fussy about polarity, so it fires for a N or S pole. I'm looking for one of these, since it's easier if one doesn't have to worry about which way round the magnet's stuck on the rotor.

So various flavours for various purposes: I'd guess that for "messing around" a switch rather than linear would be better. I reckon one only worries about the strength, as opposed to presence, of a field in specific circs.

EDIT: This Allegro App Note might be useful.
1347  Using Arduino / Networking, Protocols, and Devices / Re: Realworld uses of Arduino as web server on: January 04, 2014, 10:44:22 am
You're welcome. I was the spoon-feedee a few weeks ago on this....
1348  Using Arduino / Programming Questions / Re: How do I add equations/conversions into a sketch? on: January 04, 2014, 06:24:18 am
I'd calc the volume each time.

What ever shape it is, and assuming it's of constant cross-section, calc the area once based on the shape, call it A.

Then from there on, V = Ad where d is the depth.

d will of course be difference between the max depth say D and the reading from the sensor say h.

So add  lines:

Code:
float A = xxxxxxx; // whatever the value is
float V;
float D = xxxxx // whatever the value is
float h;

Then later in loop() where you need it:

Code:
V = A * (D-h);

1349  Community / Bar Sport / Re: karma is biased. on: January 04, 2014, 01:20:48 am
Or, ............ or (as Barney would say).... just ditch the whole karma thing
1350  Using Arduino / Programming Questions / Re: Pin13 Mega appears to have a mind of its own? on: January 04, 2014, 01:15:40 am
Haha so I was right- or at least on the right track- maybe for the wrong reason- waaaaaay back about reply #2 or 3

Edit... all thru the "post your code" hoohah, we should really have been insisting on a circuit diagram.
Pages: 1 ... 88 89 [90] 91 92 ... 269