Show Posts
Pages: 1 ... 40 41 [42] 43 44 ... 340
616  Using Arduino / Sensors / Re: pir sensor confusion on: August 28, 2014, 08:08:56 am
Yep afaik that's they way they work: there are components on the board that set that time. Some have an adjustment.

You might find this tutorial useful, even if your PIR isn't this exact one.
617  Using Arduino / Project Guidance / Re: First project: too much choice. on: August 28, 2014, 05:31:44 am

I'd scour this forum before buying one of those: strikes me, there seem to be a lot of hassles with it.
618  Using Arduino / LEDs and Multiplexing / Re: 'F' was not declared in this scope on: August 28, 2014, 02:10:14 am
Ok, thanks for the heads-up
619  Using Arduino / Programming Questions / Re: Arduino projects book project 6 on: August 28, 2014, 02:07:58 am
3, 4 whatever... close enough...

Fixed, thanks.
620  Using Arduino / Project Guidance / Re: Servo or motors not working when using pins 9,10,11 on: August 28, 2014, 12:07:08 am
If you think it's pin-related, can you use different pins to test, or are you forced to use certain pins through a shield?

Comment out all the servo related lines.

BTW, these lines at the top of loop() are redundant, since you already did this in setup():

Code:
 pinMode(rightDirectionPin, OUTPUT);
  pinMode(leftDirectionPin, OUTPUT);
  pinMode(rightSpeedPWMPin, OUTPUT);
  pinMode(leftSpeedPWMPin, OUTPUT);

Edit: It also might help if you post a schematic...
621  Using Arduino / Programming Questions / Re: Arduino projects book project 6 on: August 27, 2014, 10:23:15 pm
so my question is which is the real number of the pins on the board and wich is the correct way to call each pin number?


The only number of the digital pins is the one printed on the board, ie 0-13 on an Uno.

Analog pins are slightly more complicated: they're numbered A0-A5 on an Uno, and that's how you call them for use as digital pins. If you call them as analog pins, they're just 0-5 since the "A" is redundant. I think but never used this way, the analog pins can also just be numbered above 13.

Code:
These are all the same pin:
digitalRead(A3); //without the A, it would be digital pin 3
analogRead(3);  //can only mean A3
digitalRead(17); //not sure

That said, you can call pins by variable names as you've seen:

Code:
int ledPin=13;

digitalWrite(ledPin, HIGH);

I don't have a starter kit so I can't check, but I'm guessing that in that sketch, both pins 13 and 8 are used. 13 probably used as above, and 8 just with a simple

Code:
digitalWrite(8, HIGH);

Both ways are correct. Giving a pin a name aids readability of the code. Also makes it easy if you change your mind and move from say pin 4 to 10: just one line to change, not every line where it's used.
622  Using Arduino / Project Guidance / Re: Please help anybody on: August 27, 2014, 03:08:08 pm
Have a look at this tutorial: http://startingelectronics.com/tutorials/arduino/ethernet-shield-web-server-tutorial/

Part 5 is about having a checkbox on a webpage served out by the Arduino, checkbox controls an LED.

Then in theory it's easy to replace the LED with a solenoid which would be your door lock: http://www.ecs.umass.edu/ece/m5/tutorials/tip122_transistor_tutorial.html
623  Using Arduino / General Electronics / Re: Motorized rotary switch on: August 27, 2014, 12:55:57 pm
What's the basis for the selection?- time? ie, just scroll through the lines in a never ending loop or what? Does it require manual intervention?- in which case I guess a normal rotary switch would do  smiley-cool so I guess not?
624  Using Arduino / General Electronics / Re: Motorized rotary switch on: August 27, 2014, 12:38:21 pm
Does it have to be a motorised switch? You can switch pins easily in an Arduino, and have software doing the switching of 16 i/o pins connected to some kind of transistor or solid state relay setup....

So the Arduino is the virtual rotary switch.

A lot hangs on what an HP line is, though.
625  Using Arduino / Project Guidance / Re: RSSI-urgent help on: August 27, 2014, 10:36:58 am
Experiment for a bit with your setup and examine the RSSI values. Then you will understand why RSSI is nearly useless to estimate distance between modules.

I guess  you are right, but  please if you have sketch please send it.it is necesseray for my final project

Assuming it makes sense to show that something doesn't work, if it's for a project you should surely be writing it yourself not asking someone to "send it" to you.
626  Using Arduino / Project Guidance / Re: internal pull-up with optocoupler problem on: August 27, 2014, 07:19:35 am
I suppose it's possible that the internal pullup is stuffed; have you tried a different pin?

It is indeed, that was going to be my next point.  smiley-cool

Or as The IT Crowd fans would know... have you tried turning it off and on again mate?
627  Using Arduino / Project Guidance / Re: internal pull-up with optocoupler problem on: August 27, 2014, 07:13:57 am
I suppose it's possible that the internal pullup is stuffed; have you tried a different pin?
628  Using Arduino / Programming Questions / Re: Double Loop on: August 27, 2014, 06:32:03 am
Code:
    startTime += oneMinute;
Only subtraction involving unsigned long values is guaranteed to work..

Why's that Paul? Some subtlety under the hood presumably....
629  Using Arduino / Programming Questions / Re: relay code !! on: August 27, 2014, 06:30:49 am
Quote
It sounds like you want to turn a pump on based on some distance reading, and like you're using an ultrasonic sensor for the distance measurement. You need to tell us what kind of sensor it is (again model number), and why the distance measurement is used to control a pump.

He did tell us, but in at least 2 other threads....  smiley-yell
630  Using Arduino / Programming Questions / Re: Double Loop on: August 27, 2014, 03:37:53 am
Classic case of the need for Blink Without Delay
Pages: 1 ... 40 41 [42] 43 44 ... 340