Loading...
  Show Posts
Pages: 1 ... 35 36 [37] 38 39 ... 48
541  Using Arduino / Sensors / Re: Wiring up the DHT11 on: July 19, 2012, 06:19:26 pm
Code:
// 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
Quote
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 smiley
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.
543  Using Arduino / Programming Questions / Re: simple maths results in 0.00 on: July 18, 2012, 12:57:15 am
You just make all your factors floating point or cast them to that. You have declared everything as integer. The solution to your problem has already appeared twice in this post.
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
Quote
curious:  can one manipulate the counter variable inside a for() loop?
Yes

Quote
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?

Code:

// 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();
         }
547  Using Arduino / Networking, Protocols, and Devices / [RESOLVED] Brand new ethernet shield will not connect to network on: July 14, 2012, 07:52:12 pm
Still not working but I have filldled enough. I'll organised a replacement.
548  Using Arduino / LEDs and Multiplexing / Re: Displaying static characters on a 7x5 LED matrix on: July 14, 2012, 05:38:39 am
You will need to post your circuit and/or code in order to get meaningful help. Hard to assist otherwise on your specific questions. When you post code use the # button on the posting menu to make it legible in the post.
549  Using Arduino / Networking, Protocols, and Devices / Re: Brand new ethernet shield will not connect to network on: July 14, 2012, 02:34:19 am
Interesting thing just happened!

Plugged the board back in and the network cable and it all lit up correclty - so the board can work...

@zoomcat - the test worked fine and I got a response from your server.

Unplugged the board and cable, put it back together and it is now not working any more. I hate intermittent faults (although this is more like intermittent working).

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.
551  Using Arduino / Programming Questions / Re: How can I modify the time in the program for DS1307? on: July 12, 2012, 12:55:09 am
You change the first 8 bytes of the memory to update the time. The datasheet for the device shows the mapping of that memory area.
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.

553  Using Arduino / Programming Questions / Re: How to use millis() for delays? on: July 08, 2012, 08:12:56 pm
Have you looked at blink without delay example? That blinks a LED at set frequency which is similar to what you want to do.
554  Using Arduino / Programming Questions / Re: Is there any way to freeze Arduino code or 74HC595 Shift Register? on: July 08, 2012, 02:19:36 am
Remember to refresh the value in the loop or the loop will never end, so you don't actually do nothing

While ( variable == 1) variable = digitalRead(...);
555  Using Arduino / Microcontrollers / Re: LCD on Attiny2313 on: July 06, 2012, 06:13:47 pm
It is likely you are running out of program memory for the upload. What size is the sketch compiled and how much Flash ram has the 2313 got?
Pages: 1 ... 35 36 [37] 38 39 ... 48