Show Posts
Pages: 1 [2] 3 4 ... 1307
16  Using Arduino / Storage / Re: SD card file date. on: August 29, 2014, 04:34:40 am
I don't know which version of the Arduino IDE you have, and thus which version of the SD library you have.
17  Using Arduino / Programming Questions / Re: Serial read more than 64 bytes? on: August 29, 2014, 04:33:12 am
I'm sorry you feel that you are treated badly by this forum. There are quite a few posters who try hard to help Arduino users achieve the best from the technology.

Quote
I took out the delay(1) calls and there is no change in the length of the array I can display.

Hmm. No change? That's a little odd. Just to be certain, can you post your revised code? Even without your exact hardware it should be possible to reproduce the problem.
18  Using Arduino / Programming Questions / Re: Serial read more than 64 bytes? on: August 29, 2014, 02:12:37 am
I get all the jokes about the snippets and everything, but I can't fit all the code in here, and most of it is all wire.transmit this and wire.end transmission that. If I put all the code in no one would read the whole thing and help me. It's more fun to be sarcastic.

I see that you did in fact manage to post your code. I also read the whole thing. And I wasn't being sarcastic. And it isn't fun to be told off by people you are trying to help. So wrong on  a number of points, so far.

Code:
  Serial.begin(9600);

Since there are 10 bits to a character (8 plus start and stop bit) you can reckon on it taking 1/960 seconds for each one to arrive, that is 1.042 mS each.

So whatever you are planning to do, you better do it in under 1 mS per character or you won't keep up.

Code:
void displayChar(char myChar, int myPos, byte myDisp){
...
  Wire.begin();
  Wire.beginTransmission(0x20);
  Wire.write(0x00); // IODIRA register
  Wire.write(0x00); // set all of port A to outputs
  Wire.endTransmission();
  delay(1);
...
  delay(1);
...
  delay(1);
...
  delay(1);
...
  delay(1);
...
  delay(1);

What are those delays doing there? That is 6 mS per character (assuming the rest of the code takes no time to execute, which isn't true).

Does that device need those delays? What happens if you remove them?
19  Using Arduino / Storage / Re: SD card file date. on: August 29, 2014, 01:23:30 am
I am doing that in a temperature logger. This is with the SdFat library.

Assuming you know the time (as in the variables below):

Code:
unsigned int year;
byte month, day, hour, minute, second;

//This function returns the date and time for SD card file access and modify time.
void fileDateTime (uint16_t* date, uint16_t* time)
  {
  *date=FAT_DATE(year, month, day);
  *time=FAT_TIME(hour, minute, second);
  }  // end of fileDateTime

void setup ()
  {
   ...
  // Attach callback function to provide date time to files.
  SdFile::dateTimeCallback (fileDateTime);
  }

Now when the SdFat library wants to know the date and time it calls fileDateTime. At this point those variables should have the correct time in them (read your clock chip at that point if you have to).
20  Using Arduino / Programming Questions / Re: How to display the text entered via serial monitor on: August 29, 2014, 01:14:49 am
http://www.gammon.com.au/serial
21  Using Arduino / Programming Questions / Re: Serial read more than 64 bytes? on: August 29, 2014, 01:10:45 am
It's hard to say without seeing all your code.

http://snippets-r-us.com/

For example, how big is message? What does showMessage do?

I hop you don't have delay() in your code. You can't sit around delaying, and simultaneously expect to receive a lot of serial data.

I note that the serial buffer size is 64 bytes (if you have 1000 bytes or more of RAM) so this suggests you aren't pulling the message out of the holding buffer fast enough. Which is very likely if you are using delay.

How to use this forum
22  Products / Arduino GSM Shield / How to use this forum - please read. on: August 28, 2014, 03:43:57 pm
Please read how to use this forum for tips on how to make forum posts, and get the most out of using this forum. Thanks!

- The Arduino Forum Team


23  Using Arduino / General Electronics / Re: I2C and the Atmega328P on: August 28, 2014, 03:41:57 pm
Yes, but as I noted earlier, you can't give the code to anybody else if you do that.

That's in the library. You don't normally give that to people, they download their own. Plus, you can give it to people as long as they are aware they need to enable the pullups. Or, they could use resistors which is recommended anyway.

And if by "the code" you mean the quadcopter code, then the revised version is what will actually work.
24  Using Arduino / Networking, Protocols, and Devices / Re: Help! Program hangs at endTransmission when initializing Wii Classic Controller on: August 28, 2014, 03:39:12 pm
Thank you for your valuable information, but I've fully read the article you posted before I wired my circuit and coded my program.

Did you try the alternative library?
25  Using Arduino / Programming Questions / MOVED: Help! Program hangs at endTransmission when initializing Wii Classic Controller on: August 28, 2014, 01:52:10 am
This topic has been moved to Networking, Protocols, and Devices.

http://forum.arduino.cc/index.php?topic=263500.0

More relevant in the networking section.
26  Using Arduino / Networking, Protocols, and Devices / Re: Help! Program hangs at endTransmission when initializing Wii Classic Controller on: August 28, 2014, 01:50:57 am
See: http://www.gammon.com.au/forum/?id=10896&reply=7#reply7

In that post:

Quote
Some people have reported on the Arduino forum that I2C "hangs" under certain circumstances. This may well be because the inbuilt "Wire" library expects certain interrupts to happen, and loops until they do. If the interrupt is lost, the library hangs.

An alternative library is described here:
...

I'm not sure if that alternative library is the same one that HazardsMind mentions. In any case it sounds like an electrical problem. Do you have pull-up resistors and if so, what value?
27  Using Arduino / Programming Questions / Re: (Solved) Making print function work with F() macro on: August 27, 2014, 03:46:04 pm
The Arduino developers seem strangely reluctant to let us see compiler warnings. There may be an option for it somewhere in preferences.
28  Using Arduino / Microcontrollers / Re: Standalone ATMega2560 Sketch Upload Problem on: August 27, 2014, 03:43:13 pm
You can upload sketches using the hex uploader sketch as documented here:

http://www.gammon.com.au/forum/?id=11638

That doesn't use the serial port for programming. You will need an SD card breakout board ($15):

http://www.adafruit.com/products/254


After all, if you can program the bootloader using SPI you can program anything.
29  Using Arduino / General Electronics / Re: I2C and the Atmega328P on: August 27, 2014, 03:38:13 pm
You could always delete these two lines from twi_init:

Code:
  // activate internal pullups for twi.
  digitalWrite(SDA, 1);
  digitalWrite(SCL, 1);

They aren't needed anyway if you use hardware pull-ups.
30  Using Arduino / Programming Questions / Re: (Solved) Making print function work with F() macro on: August 27, 2014, 02:20:14 am
In verbose mode with IDE 1.0.5 I get:

Code:
sketch_aug27a.ino: In member function ‘virtual size_t my_LCD_class::write(uint8_t)’:
sketch_aug27a.ino:21: warning: no return statement in function returning non-void

That was the warning.
Pages: 1 [2] 3 4 ... 1307