|
541
|
Using Arduino / Sensors / Re: Wiring up the DHT11
|
on: July 19, 2012, 06:19:26 pm
|
// Connect pin 1 (on the left) of the sensor to +5V // Connect pin 2 of the sensor to whatever your DHTPIN is // Connect pin 4 (on the right) of the sensor to GROUND // Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor Have you connected it this way, because you say that Thanks the resistor is now sitting between 5v and pin 1 If it is all connected correctly and you are sure the library works ok, then maybe you need to check that the voltage is correct (5V) on the sensor with a multimeter. Next step is to try a different sensor 
|
|
|
|
|
542
|
Using Arduino / Sensors / Re: Wiring up the DHT11
|
on: July 19, 2012, 06:48:55 am
|
|
You should find the 10 k resistor is either connected to 5v or gnd. In that case this is the signal pin and the pin with no connection can be ignored.
|
|
|
|
|
544
|
Using Arduino / Programming Questions / Re: simple maths results in 0.00
|
on: July 18, 2012, 12:10:16 am
|
|
Is SVP 0? Have you tried printing the result.
The other thing is to make your numbers floating point so that it forces 'no integer' maths. All your factors are ints, so chances are that the number is being converted to float after the calcs. In integer maths 100-RH/100 is probably zero.
float VPDcal = ((( 100.0 - (float)RH ) / 100.0 ) * (float)SVP)
|
|
|
|
|
545
|
Using Arduino / Programming Questions / Re: wait without delay() in a for-loop... How to do this?
|
on: July 17, 2012, 09:38:25 pm
|
curious: can one manipulate the counter variable inside a for() loop?
Yes would it be considered "bad form" to do that?
Yes it is bad form, mainly because the (human) reader expects to see all the conditions in the for statement. If you just want to exit the loop use break rather than changing the index. If you want to manipulate the counter, use a while loop. In this case the reader is expecting that the condition will be worked out somewhere in the loop and is more alert to that. On the issue of running things at certain intervals, look at the MultiBlink example in the Playground. You can change this relatively easily to call functions rather than just blink LEDs, using the same table-based principle. It needs abasic understanding of calling functions indirectly and I can help if you want to go that way.
|
|
|
|
|
546
|
Using Arduino / Programming Questions / Re: wait without delay() in a for-loop... How to do this?
|
on: July 17, 2012, 07:16:32 pm
|
Would something like this work? // goes forwards for (int j = 0; j < digits; j++) { c = a + 1; d = b - 1;
unsigned long startTime = millis(); for (int i = 0; i < 30; i++) {
strip.setPixelColor((a-i)%60, i, 30-i, 0); strip.setPixelColor((b+i)%60, i, 30-i, 0);
while (millis()-startTime <= (i*2)) setCircle();
strip.setPixelColor((c-i)%60, 0, 0, 0); strip.setPixelColor((d+i)%60, 0, 0, 0); strip.setPixelColor(digits*5%60,31,0,0); strip.show(); }
|
|
|
|
|
550
|
Using Arduino / Networking, Protocols, and Devices / [RESOLVED] Brand new ethernet shield will not connect to network
|
on: July 14, 2012, 01:42:25 am
|
|
I recently bought a WizNet 5100 based ethernet + SD shield (R3?) after having used an ENC28J60 based shield.UNfortulately I am having problems trying to get this new shield to connect to the network, so I need some collective intelligence applied to this problem...
1. The power LED lights up so I know I have power. Uno is powered off the USB port. 2. The etherent LEDs on the 'HanRun' network socket do not light up. The cable plugged into a laptop works fine, so the network is operational. 3. The Webserver sketch from the IDE examples echoes ther IP address to the serial port but does not allow connections (maybe not surprisingly given 2 above). MAC address is as per sketch and the IP address is in the range for the rest of the network with no duplication.
I have corrected some solder bridges on the Wiznet chip (lower row in the picture) and there appear to be a few other on pins that look like they should be connected anyway (vertical row).
I am running an Uno board with version 1.0.1 IDE. The board is 'brand new' and I have the option of returning it, but I want to try to get it working before I invest time and money in the returns process.
Any ideas on what I can try would be appreciated.
|
|
|
|
|
552
|
Using Arduino / LEDs and Multiplexing / Re: need MULTIPLEXING 7 segment help
|
on: July 11, 2012, 02:58:46 am
|
|
Mask is a byte where only one bit is on. It starts as binary 00000001 then 00000010 then 00000100 etc as it goes thru the loop. Look up what the << operator does.
This mask is then logically anded with the bit pattern that describes which segments are supposed to be on (in the sevencode array). If the result is zero the output pin is turned off (because the bit in sevencode was off), if not it is turned on.
The display will show the segments of the 7 segment display on that were encoded in the array for the dispaly element indexed by the num parameter to the function. The array will usually encode segments a thru g in a logical sequence.
This is a very standard way of doing this. Most other schemes also include the dp for the display as one of the bit of the encoding byte as the 7 segments and the dp neatly fit in an 8 bit byte.
|
|
|
|
|