Show Posts
Pages: 1 ... 64 65 [66] 67 68
976  Using Arduino / Programming Questions / Re: Troubles using "Serial." library on: April 29, 2012, 10:29:40 am
You could try my "ShowInfo" Sketch: http://arduino.cc/playground/Main/ShowInfo there is a 'r' option to test the serial connection. It is a short loop, and during that loop you can type characters followed by enter, and see what it does.
977  Community / Website and Forum / Re: How to upload images + other beginners questions on: April 28, 2012, 06:53:36 pm
The Reference of sizeof() is now odd again: http://arduino.cc/en/Reference/Sizeof
The comment is about a string with a trailing NULL, but the example is with "myInts".
Even with 16-bit characters the variable would not be called "myInts".
And with an array of integer data, there is probably no trailing NULL.
This is confusing for new programmers.
Please make it two examples again, one for a string (with -1), one for integers (without -1).

The ATmega8 is no longer used on Arduino boards, but it is very cheap for home-made Arduino-compatible boards.
The new tone() library: http://code.google.com/p/arduino/issues/detail?id=292
978  Using Arduino / Programming Questions / Re: how to compile Atmega168PA_PU sketch on: April 24, 2012, 01:45:38 pm
Is the DTR signal connected (via a 100nF) to reset ?
Which bootloader did you use?
Burning the bootloader is not enough, did you set the fuses according to the Arduino fuse settings?
To add a new board to boards.txt is very well possible. Perhaps you made an error. Why is that not compiling?

So you see, there are many problems with this.

EDIT: I removed some lines that were wrong.
979  Development / Other Software Development / Re: yet another DHT11 Class for Arduino on: April 23, 2012, 03:04:29 am
Robtillaart,  Have you thought about using the (:source lang=c:) and (:sourcend:) for your code in the playground?
980  Using Arduino / Networking, Protocols, and Devices / Re: Arduino DS1307 with AT24C32 on: April 22, 2012, 04:01:06 am
RandallR, I think I found the problem.

I checked the return values of the Wire library, and was able to generate some errors.

Without the delay of 50ms, the device could be busy. In that case, every Wire.endTransmission() should be checked for an error. Both while writing and reading. And if an error occured, some time (5ms) should be waited before trying again.
That would increase the code size, but reading and writing would be fast.

A much simpler solution is to change your delay in the loop to 5ms, and add also a delay of 5ms to the other WriteMem() function (the byte write version).

Also other examples at the Playground use a delay:
This one http://arduino.cc/playground/Code/I2CEEPROM24LC512 uses a delay of 5ms very often.
This one http://arduino.cc/playground/Code/I2CEEPROM24C1024 uses a delay of 5ms after writing a byte.
This one http://arduino.cc/playground/Main/LibraryForI2CEEPROM uses a delay of 5ms after writing a few bytes in a page.
This one http://arduino.cc/playground/Code/I2CEEPROMBANK uses a delay of 5ms after writing a byte.

Testing: with those two delays of 5ms, eveything is okay. I can't generate any error. So that's what I'm using now.

I assume that 5ms is enough, since the datasheet of the AT24C64A says that writing is finished within 5ms. I don't know how it is for other I2C EEPROMs.
981  Using Arduino / Project Guidance / Re: Need Help with LED Binary Counter on: April 21, 2012, 07:09:22 pm
That's very strange.
It could be a low voltage, or watchdog timer, but then the result should not be like this.
So begin with something even more simpler: A blinking led.
Code:
voide loop()
{
  digitalWrite (LED0, HIGH);
  delay(100);
  digitalWrite (LED0, LOW);
  delay(300);
}
Would this result in a fast blinking led.
If not, go for something even more simpler: just turn on some leds and see if they stay on.

Are you sure that the code is actually what you test. Or do you use an analogWrite() or tone() function that uses outputs. I checked the video, and every second something happens, but sometimes there are small delays between the leds within that second. That is almost impossible.
982  Using Arduino / Project Guidance / Re: Arduino issues with accurate ADC and heat? on: April 21, 2012, 07:03:18 pm
I always use analogReference(), but after reading carefully I think it is not mandatory.
983  Using Arduino / Project Guidance / Re: wich arduino to purchace on: April 21, 2012, 06:49:27 pm
thanks i will use mosfets to do the work of the relays just to find sutable mosfets now mm smiley-red
Search Ebay for "logic mosfet". If you use low voltage lights (e.g. 12V or 24V), it's easy to do. For high voltages you could use photoMos relays, or a high DC voltage with high voltage mosfets.
984  Using Arduino / Project Guidance / Re: Need Help with LED Binary Counter on: April 21, 2012, 06:45:38 pm
You might want to rewrite your loop.
The digitalWrite uses HIGH and LOW, but the bitRead returns '0' or '1'. I don't know if that is valid, but I think it is not.

Perhaps you can start simple:
Code:
if bitRead(i, 0)
  digitalWrite(LED0,HIGH);
else
  digitalWrite(LED0,LOW);
That would result in a blinking led.

And I would do the same for all bits:
Code:
for ( int j = LED0; j <= LED4; j++ )
{
  // Check the bit in counter 'i',
  // and set the according led.
  if bitRead(i, j-pinShift)
    digitalWrite(j,HIGH);
  else
    digitalWrite(j,LOW);
}

As you can see, I use "j <= LED4". That is to avoid problems, since "LED4 + 1" might not be valid in some cases. You could do the same for the loop with the "i" counter.
985  Using Arduino / Project Guidance / Re: Arduino issues with accurate ADC and heat? on: April 21, 2012, 06:22:37 pm
1MOhm is too much for a good reading.
The analog input should have 10k, so you could use a diviver of two 22k resistors (or less).
Do you also have a delay of 20ms after setting: analogReference(DEFAULT);

Now you mention it, ground current could be a problem. That can cause all kinds of strange effects.
986  Development / Other Software Development / Re: yet another DHT11 Class for Arduino on: April 20, 2012, 12:11:02 pm
Thanks for this code for the DHT11.
It's very small, even working on a ATmega8.
And if something is wrong, version 0.4.0 always returns an error. Very nice.
I use a pull-up of 10k on the data line.
987  Using Arduino / Networking, Protocols, and Devices / Re: Arduino DS1307 with AT24C32 on: April 16, 2012, 02:13:46 pm
The Playground is a wiki, and this a forum.
It has a totally different style of writing.
There are already few pages at "I2C EEPROM" http://arduino.cc/playground/Main/InterfacingWithHardware#Storage
If you click 'edit' on top of that page, you can see the format. At the "!!!I2C EEPROM"-section you can add a page in the same format. If you save it, you can go to you new created page by clicking on it, and start writing your page.
988  Using Arduino / Networking, Protocols, and Devices / Re: Arduino DS1307 with AT24C32 on: April 16, 2012, 01:14:59 pm
RandallR, Is this the only place where you publish you code? You could add it to the Playground.
I like your code, because it handles the page boundery for me.
But is the 50ms delay necessary ?
If it is omitted, is the Wire.beginTransmission() waiting for the device to be ready ?

I have done a test with the 24C64A.
I used ReadMem and WriteMem with a buffer.
Without delay: not good, the first read after writing is wrong. Writing was good.
With 5ms delay: good
With 1ms delay: not good.

If there are wrong read bytes, the return value is still normal. So the return value doesn't show an error.
I removed the delay of 50ms and added a delay of 5ms outside the loop, just before the return. That result is also good.

So it is not the writing that needs a delay, but only the first read after writing.
I don't know what to test else, and I don't understand the delay.
989  Using Arduino / Installation & Troubleshooting / Re: Installing arduino 1.0 on: April 11, 2012, 06:58:26 pm
Same here. Just unzipped it.
990  Community / Website and Forum / Re: How to upload images + other beginners questions on: April 08, 2012, 09:16:46 pm
Answer to question (1) found.
Uploading a picture to Playgrond :
I used "Attach:filename" (without quotes), and select 'Preview'. Clicking on the 'attach' link will show an upload page.
The filename has to match.

For an image that is located elsewhere, just the link with http://.... will do, without the "Attach".
Pages: 1 ... 64 65 [66] 67 68