Show Posts
Pages: [1] 2 3 ... 326
1  Using Arduino / Programming Questions / Re: Couple of questions on: Today at 03:36:24 am
FWIW, in response to another thread, I put 6x analogReads in loop() of the test sketch in the previous post, and it dropped to 1500 loops a second.
2  Using Arduino / Sensors / Re: Simple pressure sensor wiring on: Today at 03:14:23 am
There's only one way to wire it: 5V and gnd, and analog output to an Arduino analog pin.

Arduino's loop() runs (by my trivial testing) in the 100k times a second range, so I'd guess that your readings will be often enough. Others may have specific knowledge about how long an analogRead takes though, and give better info on the possible frequency of reading.


The code below runs 150000 times a second with the 6x analogReads //'d out, and 1500 times a second with them in.

//speed test

long startTime;
long runTime;
long counter=0;
int analogReading;

void setup()
  startTime = millis();
  Serial.print("Start ");

void loop()
  runTime = millis()- startTime;
  analogReading= analogRead(0);
  analogReading= analogRead(1);
  analogReading= analogRead(2);
  analogReading= analogRead(3);
  analogReading= analogRead(4);
  analogReading= analogRead(5);

  if (runTime >= 1000)
    Serial.print("Looped ");
    Serial.print(" times in ");

3  Using Arduino / Programming Questions / Re: Motion detection on: Today at 02:56:21 am
I am beginning to think that your problem is that there may be no power to the arduino!

Or as Roy in The IT crowd would say, "Have you tried turning it off and on again?"
4  Topics / Robotics / Re: Construct the robot: what to buy? on: Today at 02:28:45 am
I recommend this ......  

Since you are a principal in that venture, I think you should say so in your "recommendation".

5  Using Arduino / LEDs and Multiplexing / Re: mapping multiple LED to switch on from multiple switches on: Today at 02:17:36 am
First thing I would do is establish a truth table of 6 columns. The first 3 columns will be switches and the second 3, the LEDs. Then you put a "1" where any switch goes on and a "1" for any led lit. Say leds 2 and 3 must come on when switches 1 and 2 are on, you would get this:

s1  s2  s3  l1  l2  l3
1    1  0    0   1   1

From there you could reduce any redundancies- say if s1 and s2 together light l3, and s1 and s3 also light l3, you could (maybe) reduce that to s1 by itself.

Then probably code it along the lines of what acegard said
6  Using Arduino / Programming Questions / Re: Motion detection on: Today at 01:55:24 am
the speaker does not sound, after the pir sense the motion continuously for 30sec

Yes I got that from the reply before, and I'm trying to help you establish why that might be. If you have serial writes in the buzzer part of the code, you'll be able to see if the logic flow is correct. If the flow is going there but it's not sounding then that's one problem; if it's not going there in the first place it's another issue altogether.

Help us to help you.

But if you won't answer the question "So have you got serial prints in the buzzer part like BL showed.....", then I'm out (of this and the other 3 threads on the same question.)
7  Using Arduino / Project Guidance / Re: Microphone, detect sound from piezo to move servo on: Today at 01:51:01 am

int sensorValue = analogRead(0);
sensorValue = map(sensorValue,0,250,0,180);

sensorValue, being an analog input, will be between 0 and 1023 but you're only using the bottom 1/4 of that in map().... is that what you meant to do or are you anticipating this being a scaling?
8  Using Arduino / Programming Questions / Re: Motion detection on: Today at 01:22:50 am
i mean no sound came out from the buzzer, after motion detected for 30sec

So have you got serial prints in the buzzer part like BL showed, so you can see if the code is actually going there in the first place?

Serial.println("Speaker On");
Serial.println("Speaker OFF");
9  Using Arduino / Project Guidance / Re: Vehicular emissions sensors ? on: Today at 01:19:24 am
I was just curious if sensors existed that were 'automobile grade'.

Automotive test equipment from the likes of Sun, Allen, MZ have been able to measure various emissions for decades, so yep such sensors must exist. Not sure what their voltage requirements might be though, since workshop equipment will all be mains driven and could be at any voltage the makers liked to step down to internally.

Maybe try to find spares for those machines, or cannibalize scrapped ones?
10  Using Arduino / Project Guidance / Re: Servo potentiometer question on: Today at 12:43:28 am
  where should I pick up the +v for the potentiometer?

What potentiometer?
11  Topics / Product Design / Re: Need help in essay writing for interaction design subject on: Today at 12:35:06 am
Are you looking any professional who can help you in your essay?

Assuming I ever needed anyone to write my work for me, I'd be very reluctant* to use a service whose headline is a sentence like this:

Seeking For A Place Which Will Come Up With Your Desirable Support In Your MBA Dissertation As You Are Facing Difficulties In Completing Your Dissertation Or You Are Not Holding Sufficient Time To Finish Your Dissertation?

* read as: wouldn't touch with the proverbial bargepole.....

edit.... ok that's interesting, the post from AlbertBarkley has gone
12  Topics / Education and Teaching / Re: How to use the function "DO WHILE" on: Today at 12:18:50 am
You did not mention the language to use Do While.

The language under discussion would implicitly be "Arduino C" for want of a better term, seeing as this is an Arduino forum. It's explicitly "Arduino C" because of this: "I'm just started to use Arduino".

(I use the phrase "Arduino C" to mean C as we write in the Arduino IDE, where there's no main() since that's taken care of behind the scenes, and where there are Arduino specific things like digitalWrite and so on. Not my intention to start a discussion on there being no such thing as "Arduino C"..... )

Moderator edit: Link to spammer redacted. (Nick Gammon)
13  Using Arduino / Project Guidance / Re: New Arduino User on: Today at 12:05:19 am
You're looking at it backwards imo..... you should search the world to get the transducers first, then spec the controller.

The specs of the transducers (stuff like: voltage, currrent, number of wires, digital/analog and more) will have a bearing on the capabilities that the controller requires.

So you'll get a controller that works with the transducers, rather than "heavy duty pressure transducers that will work with this system".

Welcome, by the way  smiley-confuse

14  Using Arduino / Programming Questions / Re: Motion detection on: September 21, 2014, 11:09:48 pm
so sprinkle in some Serial.print() debugging......

..... just like your original code in your first of the 4 threads on this subject had.

Serial.println("Motion detected!");
Serial.println("Motion ended!");
15  Using Arduino / Programming Questions / Re: Motion detection on: September 21, 2014, 09:46:01 pm
you have to get all those delays out of there and look for state changes instead of just reading the pin every so often...

Deja vu anyone?- reminiscent of this threadthis one and this one.

The OP started out with the adafruit code which does indeed use states.....  Both BulldogLowell and I have advocated the state change approach in those threads.  BL used the phrase "classic state change" in one of them; dead right.

OP seems to have regressed from the adafruit code which was on the right track but abandoned that approach in favour of the current delay-bound one.
Pages: [1] 2 3 ... 326