Show Posts
Pages: [1] 2 3
1  Using Arduino / Storage / Re: rewindDirectory doesn't? on: July 06, 2014, 05:13:01 pm
Thanks fat16lib.

I found the issue.

I had another file list routine that was filtering out specific filenames.

The file close(); you have to have with openNextFile(); was only called on the matching files so it was running out of file handles on the second pass...

I think the arduino SD reference example also omits the file close(); call too.

Nasty little bug but sorted now....

Thanks all.
2  Using Arduino / Storage / Re: rewindDirectory doesn't? on: July 06, 2014, 03:52:31 pm
That's the code I am using, In one sketch the function works in another sketch it doesn't (it only works once).

I'm not able to post the entire sketch, I have pasted the function as is though.

My question is what could cause rewindDrirectory() not to work?

Will having other files open stop it working correctly?
3  Using Arduino / Storage / Re: rewindDirectory doesn't? on: July 06, 2014, 08:00:50 am
OK, this code works in a simple test sketch but only works once in my main sketch...

Code:
void list_files2()
{
File sd_dir;
File fn;
unsigned char eof;


 
sd_dir = SD.open("/");
eof=0;


sd_dir.rewindDirectory();

 while(!eof)
    {
     fn = sd_dir.openNextFile();
     if (!fn)
       {
       // no more files
       Serial.print("\n\rEND\n\r");
       eof=1;
       }
     else
       {
       Serial.print(fn.name());
       Serial.println(fn.size());
       
       fn.close();
       }
    }
}

So any ideas what circumstances that can stop rewindDirectory() working?
4  Using Arduino / Storage / rewindDirectory doesn't? on: July 06, 2014, 07:40:32 am
I seem to have a situation where rewindDirectory(); doesn't.

On the first pass, my code gives a complete list of files in the root.
Second pass, none are shown, despite calling close after openNext(); and calling rewindDirectory(); before listing the files.

Is there some conflict with rewindDirectory() if there are other files still open?

I'll post a test routine shortly...
5  Using Arduino / Programming Questions / Re: Method to know when serial TX has finished? on: July 05, 2014, 01:58:05 pm

I was looking for ways to wait for the transmission to complete before continuing with the next process, in my case sending some data over gprs.


how about:

Code:
while Serial.available()
{
  //process your serial message
}

chew it all up at once...

I'm waiting for stuff to go out, not come in.

I'm pretty sure serial.available() is for incoming data.
6  Using Arduino / Programming Questions / Re: Method to know when serial TX has finished? on: July 05, 2014, 01:34:27 pm
I have the impression that @richardtheboffin has deleted stuff from his original post so that the rest of this Thread makes little sense.

It would be nice if you could reinstate it for the benefit of others.

...R

Indeed! I was going to delete the whole post but Mark had already answered!

I had suspicions that calling delay(); immediately after sending to the serial port may be holding up the transmission, but I was mistaken.

I was looking for ways to wait for the transmission to complete before continuing with the next process, in my case sending some data over gprs.

I have since found that the zigbee radio fails to send anything if it's been left dormant for 5 seconds and it only wakes if data is sent from the other direction...
7  Using Arduino / Programming Questions / Re: Method to know when serial TX has finished with zigbee? on: July 05, 2014, 07:34:02 am
Quote
If I just hard code in a delay(); does this block the serial transmission?
No. Interrupts happen even while delay() is wasting time.

Quote
Is there a way to find out if the tx buffer has been sent?
Serial.flush() does that. It waits until the outgoing serial buffer is empty.

Quote
I want to hold my processing until the zigbee transmission has completed.
Hold the processing of what? It's hard to guess what processing on the sender needs to wait until all data has been sent. Waiting until all data has been received is a different story, with a completely different solution.


Thanks Mark,

Just done some more testing....

It's the zigbee module that's going to sleep or something if there's no transmission for 5 seconds....
 
I need to do more digging in the xbee datasheet....

Thanks for the help though!
8  Using Arduino / Programming Questions / Method to know when serial TX has finished? on: July 05, 2014, 07:13:36 am
Is there a method to check the status of the tx buffer?
9  Using Arduino / Sensors / OV528 Serial Camera on: May 01, 2014, 08:11:26 pm
I have a Grove Serial JPEG camera which appears to be based on the OV528.

I have found several datasheets which all have slightly different information.

This module has a microcontroller on it so maybe there are different firmware versions.

For example the omnivision datasheet show commands begining with 0xFF,0xFF,0xFF but other datasheets (Lianchao Future Technology) show commands begin with 0xAA.

My board works with the 0xAA header byte.

I am getting data from the camera but I'd like to get a bitmap image rather than a jpeg. The omnivision datasheet says this is possible as the INIT command has a parameter that selects Grey scale, 8 bit, 12 bit or jpeg. The LFT datasheet has this byte labelled as Picture Type but no explanation....

Has anyone else tried using this camera and had any sucess getting a bitmap out of it?
10  Using Arduino / Project Guidance / Combined mp3 player and digital photo frame on: April 28, 2014, 02:39:33 pm
I was toying with building something that can play mp3 files and display some jpegs with some form of synchronisation and possibly some RGB led light effects.

I could use an arduino attached to an mp3 player board (very cheap option) and use a mobile phone lcd for a screen (again very cheap) but then I looked at how much cheap 7 inch tablets are now... £30!!!

I find it amazing that an arduino touch screen shield can cost more than double that!

Maybe there's an easy way to interface the tablet to an arduino to do the i/o bits and the tablet can do the slide show and mp3 playing...

Just looking for some thoughts...
11  Using Arduino / Project Guidance / Re: Arduino and MP3 on: April 28, 2014, 04:39:25 am
Been looking at the same thing. Tried a Garan audio board or Grove audio board sold by Seeedstudio?

http://www.seeedstudio.com/depot/Grove-Serial-MP3-Player-p-1542.html?cPath=38

http://www.seeedstudio.com/depot/Garan-Audio-Module-p-1607.html

In my application, I want a Jpeg viewer too, for album art etc. That's proving a little more tricky to get at low cost....
12  Using Arduino / General Electronics / Re: picture in picture chip on: April 28, 2014, 04:32:52 am
I've had a good google about, but looks like most are obsolete now...

Clearly it's all done on a SoC video processor these days. Shame. Maybe someone like Maxim will do one, like they did with the onscreen text chip...
13  Using Arduino / General Electronics / Re: picture in picture chip on: April 06, 2014, 09:52:03 am
I will try there, but I am looking to control the pip chip from an adruino...
14  Using Arduino / General Electronics / picture in picture chip on: April 06, 2014, 05:38:12 am
I am looking for a picture in picture chip that will accept composite video inputs and allow variable sized windowing.

Anyone used one?
15  Using Arduino / Networking, Protocols, and Devices / Re: GPRS basics on: February 24, 2014, 07:54:32 pm
Thanks for your comments.

I'll look into wake on lan options on my modem.
Pages: [1] 2 3