Show Posts
Pages: 1 ... 114 115 [116] 117 118 ... 353
1726  Using Arduino / Sensors / Re: Would someone please add DHT22 to Interrupt driven DHT11 Lib (idDHT11) on: July 03, 2013, 10:08:31 am
Because the line protocol of the two sensors is almost identical and just the interpretation of the received bytes differs, it should be sufficient to replace the DATA portion of the case statement in the interrupt handler as follows:

Code:
case DATA:
if(delta<10) {
detachInterrupt(intNumber);
status = IDDHTLIB_ERROR_DELTA;
state = STOPPED;
} else if(60<delta && delta<135) { //valid in timing
bits[idx] <<= 1;
if(delta>90) //is a one
bits[idx] |= 1;
if (cnt == 0) {  // whe have fullfilled the byte, go to next
cnt = 7;    // restart at MSB
if(idx++ == 4) {      // go to next byte, if whe have got 5 bytes stop.
detachInterrupt(intNumber);
// WRITE TO RIGHT VARS
uint16_t rawhum    = bits[0];
rawhum <<= 8;
rawhum |= bits[1];
hum = rawhum * 0.1;
uint16_t rawtemp = bits[2];
rawtemp <<= 8;
rawtemp |= bits[3];
temp = (rawtemp & 0x8000) ? -(int16_t)(rawtemp & 0x7FFF) * 0.1 : rawtemp * 0.1;
uint8_t sum = bits[0] + bits[1] + bits[2] + bits[3]; 
if (bits[4] != sum) {
status = IDDHTLIB_ERROR_CHECKSUM;
state = STOPPED;
} else {
status = IDDHTLIB_OK;
state = ACQUIRED;
}
break;
}
} else cnt--;
} else {
detachInterrupt(intNumber);
status = IDDHTLIB_ERROR_TIMEOUT;
state = STOPPED;
}
break;
1727  Using Arduino / Sensors / Re: Thermistor Configuration on: July 03, 2013, 09:15:12 am
Code:
// Calculate mV from temp sensor output
  double voltage = sensorValue * aref_voltage;
  voltage /= 1024.0;

This does not calculate mV but V, but it seems that's what the rest of the code expects anyway.

Quote
I had meant, was connecting it to a mosfet, with the wheatstone bridge a good idea.

You might have to describe that in detail, I don't understand what you're trying to do. You already have the resistance values for the two basic temperatures, what do you need the wheatstone bridge for then? What kind of role does the MOSFET play in this equation?
1728  Using Arduino / Networking, Protocols, and Devices / Re: SoftwareSerial 7-E-1 problem on: July 03, 2013, 05:19:37 am
Try to replace that line

Code:
ir.print("/?!\r\n");

by

Code:
ir.write(0xAF); // "/"
ir.write(0x3F); // "?"
ir.write(0x21); // "!"
ir.write(0x8D); // "\r"
ir.write(0x0A); // "\n"

That's your string but even parity precalculated. The standard version of SoftwareSerial doesn't calculate parity bits.

Another possibility: use just the USB2Serial converter of the UNO. Connect the TTL-IR-Read-Write head to the Arduino's serial interface (pin 0 and 1) but crossed over and load an empty sketch before (the Blink example is perfect for this because it doesn't use the serial interface). That way the ATmega16U2 just converts the USB serial port to a TTL level signal and the PC settings come to an immediate effect.
Die andere Möglichkeit wäre, die Kontrolle vom PC aus zu machen und nur den USB2Serial converter zu benutzen. Dazu müsstest Du d
1729  Using Arduino / Networking, Protocols, and Devices / Re: arduino based twitter client on: July 03, 2013, 04:47:58 am
I cannot find your code in the post, did you forget it?
1730  Using Arduino / Networking, Protocols, and Devices / Re: A doubt about I2C and arduino on: July 03, 2013, 04:41:19 am
Quote
No one said about slave sending data to master without a request.

That's because the I2C standard doesn't contain that kind of transfer. That's why it's called "master" and "slave". The master controls the bus and the communication is always the way that the master requests data from the slaves. The only allowed action for the slaves is clock stretching if the master is too fast for the slaves.

You either have to poll the slaves frequently to ask if they had an event occurring or use another communication interface, like Ethernet between the Arduinos.
1731  Using Arduino / Networking, Protocols, and Devices / Re: Uploading Sketch On Ethernet Board Through Network on: July 03, 2013, 04:34:33 am
Are you really sure you have configured your network with a network mask of 255.0.0.0? This is quite unusual, no home router I'm aware of uses that as it's default setting.

You have to specify the complete path to your avr-objcopy executable because it's not in the standard executable path. So your command has to look like this:

Code:
C:\Users\Arduino\Desktop\Arduino\arduino-1.0.3\hardware\tools\avr\bin\avr-objcopy.exe -j .text -j .data -O binary C:\Users\Arduino\AppData\Local\Temp\build5384361910356812517.tmp\BlinkUploadTest.cpp.elf BlinkUploadTest.bin

You may have to change the paths if you've change anything in the meantime (IDE version, new compile run, etc.).
1732  Using Arduino / Networking, Protocols, and Devices / Re: Read serial data from 3DR radios on APM1 on: July 03, 2013, 04:23:04 am
That's exactly the hardware I studied for my previous post. The receiver has a pin naming that doesn't conform to the usual logic. The pin named "TX" on the module has to be connected to the RX pin of the Arduino because there's the data that's received from the PC. The Arduino's TX pin must be connected to the pin named "RX" on the module because everything sent to that pin is then transmitted to the PC. You can see in the module's schema that the "TX" pin is connected to the "DTX" pin of the HM-TRP chip and that pin is an output which has the data received from the remote (PC) side.
1733  Using Arduino / Networking, Protocols, and Devices / Re: Read serial data from 3DR radios on APM1 on: July 02, 2013, 01:50:29 pm
Maybe you have some different module than the one I was looking at. Post a link to the datasheet of all the hardware you're using!
1734  Using Arduino / Sensors / Re: Thermistor Configuration on: July 02, 2013, 01:49:02 pm
Quote
but for now does this sound like a good idea.

A good idea for what? What do you want to achieve? To read the temperature with an Arduino there are much simpler methods.
1735  Using Arduino / Sensors / Re: Capacitive Sensing and Ground on: July 02, 2013, 01:45:47 pm
The problem is, that the change in capacity of that sensor is extremely low, so the circuit has to be very sensible to detect it. If you connect your laptop the Arduino while sensing but not grounding the board as described it's quite probable that it won't work. So either do a proper grounding of the Arduino or make it self-contained (with no outside connection at all), at least that's my understanding of it (I'm not an expert in this regard). I don't know if it works with the very simple example from the playground but there are lot's of sensors working exactly the same way in wearable electronic devices which also don't have a fixed ground nor a body connection.
1736  Using Arduino / Networking, Protocols, and Devices / Re: Read serial data from 3DR radios on APM1 on: July 02, 2013, 01:33:33 pm
According to the datasheet (page 10, figure 3), the pin that has to go to RX on the Arduino is DTX. In my reading of your description you have wired it the other way around, haven't you?
1737  Using Arduino / Networking, Protocols, and Devices / Re: Read serial data from 3DR radios on APM1 on: July 02, 2013, 12:22:11 pm
Code:
#define BAUDRATE 57600

Don't use the SoftwareSerial for anything above 38400 baud, many devices even don't work with it above 9600 baud. The timing of the SoftwareSerial is not as exact as the hardware serial, which shows up much more at the higher baud rates. The hardware serial interface does some speed adaption which also makes it more reliable. SoftwareSerial is OK for reading some GPS data if the hardware serial is already used but is not complete drop in replacement for the hardware.
1738  International / Deutsch / Re: Programmauslegung - Speicherbedarf on: July 02, 2013, 11:51:35 am
Code:
Motor* motor1;

if( //Bedingung)
{
    Motor motor;
    motor1 = &motor;
}

Das funktioniert nicht. Sobald die schliessende geschweifte Klammer erreicht wird, geht motor out-of-scope, der Stack wird also geräumt und somit ist der Zeiger auf das Objekt nicht mehr definiert. Ein späterer Zugriff darauf wird höchstwahrscheinlich schief gehen (falls der Speicher schon wieder anderweitig verwendet wird).
1739  Using Arduino / Programming Questions / Re: Hardware Serial to Software Serial, is that possible ? on: July 02, 2013, 11:42:59 am
Quote
Do you know if it's possible even with low baud rate, to perform this task without have any problem to update the 2nd device firmware once this task will be executed only one time ?

If you don't use the two interface at the same time, it will probably work. If you want to provide the data to be sent over the SoftwareSerial by the hardware serial interface you probably get problems sooner or later because the SoftwareSerial is disabling all interrupts while it's running, so the hardware serial interface (which depends on interrupts to get a received byte into the reception buffer and to get the next byte of the sending buffer into the appropriate register for sending).
1740  International / Deutsch / Re: Wie kann ich ein Stromstoßschalter erstellen? on: July 02, 2013, 11:35:22 am
Quote
Ein Stromstoß-Schalter ist entweder ein oder aus, braucht aber weder in der einen noch in der anderen Stellung selber Energie. Nur zum Umschalten.
Und bleibt ohne Stromversorgung in seiner letzten Stellung.

Zumindest nach Wikipedia ist ein bistabiler Wechselschalter, der über eine steigende Flanke des Eingangssignals schaltet bereits ausreichend, dass so ein Ding als Stromstoss-Schalter bezeichnet wird. Es steht nicht davon, dass er in den beiden Stellungen keine Energie brauchen darf. Das ist meiner Meinung nach auch nur bei der mechanischen Variante der Fall, im elektronischen Fall wird immer etwas Energie verbraucht.

Dafür allerdings einen Arduino einzusetzen macht höchstens wegen der Lernerfahrung einen Sinn.
Pages: 1 ... 114 115 [116] 117 118 ... 353