Show Posts
Pages: 1 ... 281 282 [283] 284 285 ... 405
4231  Using Arduino / Programming Questions / Re: RAM usage question: PROGMEM vs const vs #define on: November 18, 2011, 01:21:00 pm
#define is just a macro definition.  The complier goes through the code and replaces the keyword with whatever value you tell it before compiling.

#define pin 8
digitalWrite(pin, HIGH);

is exactly the same as:
digitalWrite(8, HIGH);

The trick is that 8 in this case, is a constant.  Constants can still use RAM.  The complier may put the constant into RAM and then reference that constant throughout the code.  

They keyword const still consumes RAM.  The word "const" only tells the complier that the code can't change the value.  So if you try to assign a const a value, the complier will throw an error.

Quote
Then I wonder what would really be the use of the last method: PROGMEM
it seems to need more code, is more complicated, so what is the point?
The point is that off the 4 (which is really 3) methods you listed, this is the ONLY method which will not leave stuff in RAM.  The pointers will pull the constants out of PROGMEM but they won't ever get copied to RAM (unless you do it in your code.)
4232  Using Arduino / General Electronics / Re: Buy component in a store? on: November 18, 2011, 01:15:02 pm
If you can't find a store that sell components locally, your options are limited. 

We have Fry's in the US (not sure if they operate in Canada) as an alternative to Radio Shack.  Relatively high prices but vastly larger selection compared to RS.  You might also look into local Hackerspaces.  They might have an inventory of parts or the members might know of other options.

When I placing orders online, I am always looking for parts to pad an order with.  I keep a running list of "parts to order."  Resistors, capacitors, LEDs, chips, etc.  Over time you'll build up an inventory of parts. 
4233  Using Arduino / General Electronics / Re: A question about Crystal's caps & reset pin on: November 18, 2011, 01:09:35 pm
The cap resistor quickly pulls the signal high again taking the ATmega out of RESET.

Okay, more correctly stated, the cap allows the signal to stay low long enough for a RESET.  DTR takes it low while the pull-up resistor starts to charge it again.

Better?  smiley
4234  Using Arduino / Installation & Troubleshooting / Re: USB Port selection on: November 18, 2011, 01:05:11 pm
Yes same COM3 shows up and I can't select anything else as it is frozen . Thanks for the
Okay so now you know that COM3 isn't the Arduino.  No point in trying to program it.  The IDE only lists the com ports that Windows tells it.  If the IDE doesn't see the Arduino it is because your operating system doesn't either.

You are installing the FTDI drivers, correct?

What you plug the board in, what shows up in Device Manager?

4235  Using Arduino / Installation & Troubleshooting / Re: Arduino Ethernet on: November 18, 2011, 01:03:33 pm
I do not understand, why they do not include some simple programming cable into the package then.
You need a USB to Serial chip, not just a "cable."   FTDI breakout board is the most common.  None of the arduino boards that lack the USB to Serial chip come with such a breakout.  Why?  Just the way it is.  As for manual, again, none of the Arduino boards ship with any kind of manual.  All technical information is available on arduino.cc.  It would be pointless to include a paper manual.


Do you have a printer?I just unplugged my printer to program arduino. Was easy enough.
The Original Poster is using the "Arduino Ethernet" which does not have an on-board usb to serial chip.  So there would be no where for them to plug the USB cable into.
4236  Using Arduino / General Electronics / Re: A question about Crystal's caps & reset pin on: November 18, 2011, 11:14:56 am
Both of your drawings are the same.

Generally capacitors are used with buttons to keep them from bouncing.

On the Arduino schematic, you'll see a capacitor connected to RESET and DTR.  This is to allow "auto-reset" to work.  The serial-to-usb chip pulls DTR low, which causes the ATmega to RESET.  The cap quickly pulls the signal high again taking the ATmega out of RESET.
4237  Using Arduino / Installation & Troubleshooting / Re: Arduino Ethernet on: November 18, 2011, 11:08:28 am
You cannot program the ATmega through the Ethernet interface.  The Ethernet chip is not active until the ATmega uses it.  You need to use a FTDI cable (or a ICSP) to program the ATmega before you can use the Enthernet chip.
4238  Using Arduino / Installation & Troubleshooting / Re: USB Port selection on: November 18, 2011, 11:04:04 am
You didn't answer my question:
quit the ide, disconnect the arduino.  when you reload the ide, does the same com port show up?

If COM3 shows up when the Arduino is disconnected, then COM3 isn't the Arduino.
4239  Using Arduino / Installation & Troubleshooting / Re: USB Port selection on: November 17, 2011, 11:28:00 pm
quit the ide, disconnect the arduino.  when you reload the ide, does the same com port show up?

did you reinstall the ftdi drivers?
4240  Using Arduino / Installation & Troubleshooting / Re: Problem with AVRDude on: November 17, 2011, 11:26:59 pm
how did you build your static library?
4241  Using Arduino / Installation & Troubleshooting / Re: Problem with AVRDude on: November 17, 2011, 08:22:36 pm
Where did you get " -DF_CPU=1843200UL"?

Shouldn't it be 1600000? (or are you running a 18.43MHz crystal.)
4242  Using Arduino / Installation & Troubleshooting / Re: [doubt] how do analog innput pins exactly work? on: November 17, 2011, 08:17:32 pm
so i must consider the AtMega as an ideal voltmeter with infinite resistance (with reason, of course, i'm not going to attack a car battery to it),

The only concern with a car battery is that it is 12V while the maximum input of Arduino IO pins is around 5V (depends on what voltage VCC is at). The current capacity of the source (in this case a car battery) is irrelevant. The Arduino is not an infinite resistance, it is a very high resistance.
4243  Using Arduino / Installation & Troubleshooting / Re: Arduino Mega on Mac OS on: November 17, 2011, 08:13:29 pm
First time I have heard of this on OSX.  Where did you buy your mega from?
4244  Using Arduino / General Electronics / Re: Increasing voltage output on: November 16, 2011, 09:32:33 pm
9v for an LED?  Something seems off here.
4245  Using Arduino / Programming Questions / Re: How to select the printf runtime library? on: November 16, 2011, 06:56:07 pm
Print to where?

Why not use the Arduino "Serial.print()" and "Serial.println()" instead?
Pages: 1 ... 281 282 [283] 284 285 ... 405