Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 319
61  Using Arduino / Programming Questions / Re: Need help with some coding ( 2 servos 2 potentiometers) on: September 10, 2014, 01:56:14 am
as long as you use analogRead, zero and one will work just as well.
Huh, I didn't know that. Seems confusing to do it that way, though.

Disagree, analogRead can only be done on analog pins, by definition, so it's redundant to refer to them as "An"
62  Using Arduino / Project Guidance / Re: NOOB - how to call a function on start up when button is pulled high. on: September 10, 2014, 01:53:14 am
I'd try something like this...

Code:
if(duration >= 3000 && !eepromWritten) // <<<<<<<< see change here, ! means "not"
           {
             Serial.println(buttonPushCounter-1);
             //write number of button presses to mem 25
             EEPROM.write(25, buttonPushCounter-1);
            eepromWritten = true; //<<<<<<<<<<<<<<<< set the flag so next time it will fail the "if test"
              // remember to declare the eepromWritten flag as false earlier in the code <<<<<<<<<<<<<<<<<<<<
             //value = EEPROM.read(25);
             //Serial.print(value);
             delay(1000);
            } 
63  Using Arduino / Project Guidance / Re: Hissing/Humming noise from arduino Uno R3 board when codes are loaded in. on: September 10, 2014, 01:30:10 am
As aforementioned, after plugging in a myriad of inputs and outputs for both analogue and digital pins there is a humming/hissing noise from the board after the codes are loaded into the board. Please advice

"Myriad" isn't a term too well understood here, so might be a good idea to provide a schematic. Also post the code.

My wild guess is some kind of current overload, but I really don't know. Are you sure the sound is from the board and not one of the myriad of devices connected?
64  Using Arduino / Motors, Mechanics, and Power / Re: Am I connecting the common ground in this situation properly? on: September 09, 2014, 11:45:33 pm
How do you hide the link underneath the word "here" ?

Edit the url tags (the globe above the  smiley-roll-sweat)  like this. In the example below I added a space after the [ so that it shows rather than working.

Example:

Have a look at [ url=http://arduino.cc/en/Reference/Break]this[ /url]

Have a look at this
65  Using Arduino / Motors, Mechanics, and Power / Re: Am I connecting the common ground in this situation properly? on: September 09, 2014, 11:34:08 pm
If I were you I'd go with the schematic from the tutorial, perhaps with the bigger base resistor.

Look here and you'll see confirmation that the load goes above an NPN.

I realise this is academic and you probably know you don't need a transistor to switch an LED, but you certainly don't need a Darlington. Look at that page's pic of a Darlington and you'll see the gain is huge. That's because it's two transistors in a sort of chain.

Look at the table, and you'll see that for a lot of cases you can just use a "normal" (as opposed to Darlington) transistor like a BCxxx.
66  Using Arduino / Motors, Mechanics, and Power / Re: Am I connecting the common ground in this situation properly? on: September 09, 2014, 11:18:44 pm
I folloewd the quick tutorial that jimbo posted and it is working now....... Are there any suggestions for base resistor value?

There's a 1k in the tutorial, so that answers that I'm sure.  .... edit: or better yet heed the calc in an earlier reply.
67  Using Arduino / Motors, Mechanics, and Power / Re: Am I connecting the common ground in this situation properly? on: September 09, 2014, 11:08:13 pm
Sorry About that. Here are the Fritzing schematics

I don't have Fritzing installed so can't open those. I think Fritzing can export a pic, like a jpeg or similar: attach those for people to see more easily. (Make sure they're scaled down to 1-200k for easy viewing without too much (any...) scrolling.

But I'd go with what raschammel says, re the base resistor. And there is no doubt that with an NPN transistor you ought to have the load on the collector.
68  Using Arduino / Motors, Mechanics, and Power / Re: Am I connecting the common ground in this situation properly? on: September 09, 2014, 10:39:16 pm
You should attach the schematic to the post; many (read as: I) are reluctant to go to those respositories to see your pix.

From the description it seems you have the load on the emitter which is wrong for an NPN transistor.

Here is a circuit with a similar (not identical) transistor, with the load on the collector.
69  Using Arduino / Programming Questions / Re: Mosquito Anti Loitering Device on: September 09, 2014, 10:03:34 pm
The best way to see if your program has mistakes is:

  • Compile it: if it has compile errors then yes it has mistakes
  • If / when it compiles, run it: if it doesn't do what you want then yes it has mistakes.

It compiles for me, so no compile errors, but there is no way that anyone except you can say if it runs right.

BTW, please put your code in code tags. Go back to top post, choose Modify, select the code, and hit the # button above the  smiley-wink smiley-sweat smileys.

Code:
Then your code
will
{look like this}



70  Using Arduino / Programming Questions / Re: Quadrature Encoder Changes on: September 09, 2014, 10:39:05 am
Here's how I did it on a two-pin encoder, with direction.

http://forum.arduino.cc/index.php?topic=261411.0

thanks JimboZA

Actually what I want is to get accurate results from encoder and as I understood that I should use two channels of encoder with interrupt , but in your code , there is no interrupt !.

Yeah I don't know how fast it can go before it may lose counts. But it shows the principal involved in seeing which way it's turning, by seeing which channel changes first.

Who knows, it may work at decent speeds. Remember that loop() is running at the order of 100k times per second.
71  Using Arduino / Project Guidance / Re: upload data when switch is pressed on: September 09, 2014, 09:31:59 am
I have no idea on the Android comms side, but the switch part is easy. Just connect the switch to an i/o pin on one side, with pullup resistors enabled, and fround fround? ground  smiley on the other. Then have an "if" that requires that pin to go low (button pressed) and inside there, do the Android stuff.

72  Using Arduino / Programming Questions / Re: Quadrature Encoder Changes on: September 09, 2014, 09:22:13 am
Here's how I did it on a two-pin encoder, with direction.

http://forum.arduino.cc/index.php?topic=261411.0
73  Using Arduino / Programming Questions / Re: Please Help: Multi Coin Slot Acceptor Pulse Reader to Relay Switch on: September 09, 2014, 09:17:16 am
I don't think we understand the input relay thing.

As far as the output goes, well all you need to do is have an "if" statement which switches one of three pins under the right circumstances, and those pins will have relays hooked something like this.

BUT..... if you're the real beginner you say you are, you're putting the cart before the horse and you need to learn the basics from somewhere like this.
74  Using Arduino / Programming Questions / Re: Random Blinking LED Coding on: September 08, 2014, 11:19:34 pm
Quote
 digitalWrite(ledPin, !digitalRead(ledPin));

The use of ! might be "basics" to you BL, but I'll bet it's not "basics" to the OP.....
75  Using Arduino / Programming Questions / Re: Error of Code compile on: September 08, 2014, 11:17:25 pm
How does one open a rar file?

Post code like normal.

Read the error: it tells you exactly what's wrong.....
Pages: 1 ... 3 4 [5] 6 7 ... 319