Show Posts
Pages: [1] 2
1  Using Arduino / Networking, Protocols, and Devices / Re: Looking for a simple, inexpensive pulse transmitter/receiver on: November 26, 2012, 03:35:02 pm
Thanks oric_dan, but that device supports just one "button" and there is no clue about its range. It's interesting nevertheless, it might see application on other projects.

I'm afraid I'll have to resort to an XBee, which in itself is not bad, but using an extra arduino + software for doing what a dumb telecommander would accomplish seems like a waste.
2  Community / Website and Forum / Website very slow on: November 26, 2012, 01:46:12 pm
The web site (and specially the forum) is very slow, with most requests taking minutes. I observed this on most occasions I access the site since I joined the community a few weeks ago.

Is this generalized or just for my area? (I'm from Spain)
3  Using Arduino / Networking, Protocols, and Devices / Re: Looking for a simple, inexpensive pulse transmitter/receiver on: November 26, 2012, 01:03:38 pm
I'm not interested on transmitting data, just ON/OFF states. The product I referenced has 6 switches which would correspond to 6 push buttons: you just need to put the transmitter into a box with 2 AA batteries, add a few wires connecting the buttons to the TX switches, and you have the complete transmitter. For the receiver, just connect the outputs of the receiver to the Arduino inputs, and you are done. The full setup is just a bit more complicated than using straight push buttons on a breadboard.

If I understand correctly, using something like the RFM12 requires a device (such as another Arduino) for driving the transmitter, apart from some sophisticated software, as you mention.
4  Using Arduino / Networking, Protocols, and Devices / Looking for a simple, inexpensive pulse transmitter/receiver on: November 26, 2012, 12:13:07 pm
As the subject says, I need a pulse emitter and receiver, with a range of 100 meters (outdoors) with two or more inputs/outputs. Something like this would be ideal:

http://www.cdt21.com/products/tx_rx/cdttx02m/

The problem is that they are expensive: about 225 euros for a pair of transmitter and receiver.

Any suggestions?
5  Using Arduino / General Electronics / Re: Right method for activating internal pull-up resistors on: November 15, 2012, 04:00:01 pm
Lefty:

Quote
Some people wanting 'fool proof' button circuits will wire a series 200 ohm resistor from the I/O pin to the button switch as a extra safety measure, say from a human programming error where you set a pin to output by mistake (say setting it HIGH) and then the poor user presses the button wired to ground and poof goes the I/O pin. RuggedCircuits uses that in their ruggedized version of a arduino board.

My brain-fart was caused by a tutorial giving precisely that advice:

http://www.ladyada.net/learn/arduino/lesson5.html

Quote
Whats this 100Ω resistor all about? There's a 100Ω resistor we use to connect the input pin to either HIGH or LOW voltage. Why is it there? Well, lets say you accidentally set P2 to be an OUTPUT type pin, but then you connected it to 5V. If you write a LOW to the pin (0V) but its connected to HIGH (5V), you've basically caused a short circuit at that pin. This isn't very good for the pin and could damage it! The 100Ω resistor acts as a buffer, to protect the pin from short circuits.

(I'm not blaming the tutorial, but my faulty memory.)
6  Using Arduino / General Electronics / Re: Right method for activating internal pull-up resistors on: November 15, 2012, 07:01:24 am
Nick Gammon:

Quote
How would it damage the pin? An input pin is high impedance.

doh! so the pull-up is just for avoiding floating values.

Riva:

Quote
pinMode(pin, INPUT_PULLUP); works on IDE v1.0 and up

One line of code less. Nice.

BTW, even if the pins default to INPUT, IMHO it is a good practice to explicitly set the mode. Sort of self-documenting software.

MarkT: Noted.

My circuit has some normally-open buttons. I was concerned about the possibility of having them pressed before the pin was configured. I see that there is no reason for worrying.

Thanks all.
7  Using Arduino / General Electronics / Right method for activating internal pull-up resistors on: November 15, 2012, 05:10:04 am
This is the method I've seen everywhere:

pinMode(pin, INPUT);
digitalWrite(pin, HIGH);

What happens if pin already is under a non-ground voltage? Between the pinMode and the digitalWrite the current can freely flow in and damage the pin, right?

Isn't more correct the reverse approach? (putting the pin HIGH and then changing the mode to INPUT)
8  Using Arduino / Programming Questions / Re: Fighting Arduino's IDE smartness on: November 14, 2012, 04:56:03 am
I filed a bug report about this:

http://code.google.com/p/arduino/issues/detail?id=1112

and a helpful maintainer said that leaving the .ino file empty (put any comment, just to keep the compiler happy) and writing the code on a file with the .cpp extension on the same directory keeps the IDE away from messing with function prototypes. You must put the required #include's on the .cpp file too. On my case just

#include "Arduino.h"

This has another advantage: the compiler's output is related to the real file you wrote, not to some transformation, so any warning or error messages will mention the correct line number.
9  Using Arduino / Programming Questions / Re: The new 1.0.2 is showing some thing about undefined reference to `setup' on: November 13, 2012, 05:50:55 pm
An Arduino sketch requires to define a `setup' function, even when it is empty. Such function is used for setting up things you may use on the `loop' function. Since you use the Serial object, it is a good idea to initialize it on the `setup' function. Just add this to your code:

Code:
void setup() {
  Serial.begin(9600);
}
10  Using Arduino / Programming Questions / Re: Fighting Arduino's IDE smartness on: November 13, 2012, 05:35:34 pm
Quote
Look at the File + Preferences dialog.

Ok, marking the "Show verbose output during compilation" checkbox makes the trick.

The compiler is fine, there is no fancy switch passed to it. The problem is the Arduino IDE prepending the user's source code with the auto generated declarations. This is what observed:

  • Writing a declaration makes no difference: the IDE generates a declaration anyways.
  • Since the declaration generated by the IDE is placed at the top of the source file that is actually passed to the compiler, any user-defined type is undefined at the point the declaration is parsed.
  • The idiom `void foo(struct S&)' is accepted because it contains a declaration of `S' as an struct.'

Quote
Not using the IDE.

Ok. I looked at the preferences.txt file and even experimented with a few suspects, but there is nothing there that achieves what I want. So I guess that the only way of adding a switch to the the compiler command is altering the source code of the IDE.

Thanks again PaulS.
11  Using Arduino / Programming Questions / Re: Fighting Arduino's IDE smartness on: November 13, 2012, 04:48:39 pm
PaulS,

That's great to know, thanks!

AFAIK the IDE uses avr-g++ 4.7.0 on Linux and 4.3.? on Windows. Both are recent enough to not require the C-ism shown in your code, so I guess that some switch is passed to the compiler that puts it on a special mode. My guess is that such mode is required for compatibility with legacy code that the Arduino or AVR system still uses.

Is there a way to see the complete command that is used to invoke the compiler?

(And is there an option somewhere to change the compiler switches? I'll like to take advantage of some C++11 features.)
12  Using Arduino / Programming Questions / Re: Fighting Arduino's IDE smartness on: November 13, 2012, 02:53:33 pm
CrossRoads, PeterH,

I see quite a few C programmers here  smiley

In C++, you don't need the typedef for declaring a type while declaring a struct, nor do you need the `struct Boton {...} boton1' or `struct Boton boton1' syntax for declaring instances. Struct basically works the same way as for `class', although with differences like default accessibility level of members and inherited classes/structs.

But I digress. Neither using the typedef trick nor adding a function declaration for `Chequea' just after the type declaration solves the problem.
13  Using Arduino / Programming Questions / Re: Fighting Arduino's IDE smartness on: November 13, 2012, 02:01:55 pm
I thought this is a well-known problem. Anyways here it goes a trivial test case (tested with IDE 1.0.1, 1.0.2 gave the same problem with a similar albeit more complex case):

Code:
struct Boton {
  int pin;
};

void Chequea(Boton &b) {
}

void setup() {
}

void loop() {
}

which gives:


arco.cpp:2:14: error: variable or field ‘Chequea’ declared void
arco.cpp:2:14: error: ‘Boton’ was not declared in this scope
arco.cpp:2:21: error: ‘b’ was not declared in this scope


For the time being, I solved this specific instance by making Chequea a method of Boton, but I'm pretty sure that the problem will appear again and again.
14  Using Arduino / Programming Questions / Fighting Arduino's IDE smartness on: November 13, 2012, 12:56:22 pm
On some simple code I wrote, the IDE is reporting compiler errors which are pure nonsense. I suspect of some issue related to

http://arduino.cc/en/Guide/Troubleshooting#toc22

The troubleshooting tip describes the problem, but there is no mention on how to solve it, apart from a special case.

How can I stop Arduino from messing around with the code I wrote?

How can I see the code that is actually sent to the compiler? And the unmassaged compiler output?
15  Using Arduino / Sensors / Re: Medium-range RF signaling device on: October 21, 2012, 06:12:07 am
I was looking for recommendations naming specific products  smiley-roll-sweat (I'm a novice on electronics and a complete beginner on Arduino.)
Pages: [1] 2