Show Posts
Pages: [1] 2 3 ... 113
1  Using Arduino / Project Guidance / Re: Responding to DTMF tones and generating tones in reply over phone line on: September 19, 2014, 07:09:00 pm
See my thread here: http://arduino.cc/forum/index.php/topic,121540.0.html

Pete
2  Using Arduino / Programming Questions / Re: GPS and eeprom problem. on: September 19, 2014, 05:46:51 pm
EEPROM.write only writes one byte to the address but it is not writing the first of the 4 bytes. The floating point number 48.356789 will be converted to an unsigned character, which will result in 48, and that will be written to the address.

Pete
3  Community / Bar Sport / Re: Scotland Reveals Currency Plan on: September 19, 2014, 03:43:37 pm
Bagpipes and haggis aren't dangerous weapons?

Pete
4  Using Arduino / Programming Questions / Re: Using the pow() function?? on: September 19, 2014, 10:30:19 am
Quote
create an exponential map
Do you mean draw a graph of an exponential function? If so, what sort of display are you going to use?

Pete
5  Using Arduino / Project Guidance / Re: Problem with FFT on: September 19, 2014, 10:26:23 am
Quote
for an academic requirement I need to understand FFT and then implement the algorithm in assembly
When do you have to have this done?
Writing an FFT in assembler when you don't even understand what an FFT is, is going to be mighty difficult.

Pete
6  Using Arduino / Programming Questions / Re: Compiler warning when using F() macro on: September 18, 2014, 03:24:51 pm
This thread might help: http://arduino.cc/forum/index.php/topic,102182.0.html

Pete
7  Using Arduino / Programming Questions / Re: Can't open file on SD card even though it exists on: September 18, 2014, 01:01:54 pm
When I compile this for a Teensy2 it reports that sram usage is 1543 bytes. If you have 2kB of sram this should be sufficient.

You have this code:
Code:
                    if(StrContains(filename, ".htm")) {
                        webFile.close();
Are you guaranteed that webFile exists at that point? It might be best to use
Code:
                        if(webFile)webFile.close();
which you have done elsewhere in the code.

Pete
8  Using Arduino / Programming Questions / Re: Can't open file on SD card even though it exists on: September 18, 2014, 12:38:07 pm
It would help if you showed what output you get on the serial monitor. It would also help to have a few more debugging statements. For example, add these as shown:
Code:
                   ExtractFileName();
Serial.print ("filename = '");
Serial.print(filename);
Serial.println("'");
so that you can see whether filename really is what you're expecting.

Pete
9  Using Arduino / Project Guidance / Re: I need 10 mbyte of ram memory for my arduino on: September 17, 2014, 02:30:14 pm
The W25Q128FV is a 16Mbyte SPI flash chip. I have played with a couple of them on the Teensy3.1 with the audio board adapter. The chip is about $3, in ones, from Digikey (which has the SOIC form, I don't know if/where you can get the PDIP which would be easier to breadboard).
I've done some simple measurements of the speed. Writing a 256 byte page takes 814us and reading a 256 byte page takes 429us (on average). This is with normal SPI. If you can figure out how to do it, you could use dual or quad SPI modes and really speed it up!
However, you won't be writing continuously to the chip at those speeds. Once you've filled it up, you would have to erase the chip in blocks of 4kB, 32kB or 64kB or erase the whole chip and each of these takes a comparatively long time to finish. I measured a  sector erase (4kB) at 90315us. The datasheet (page 86) says a chip erase typically takes 40 seconds, which is in line with what I have observed.

Pete
10  Using Arduino / Programming Questions / Re: 3D maths to sutract gravity from accelerometer data on: September 16, 2014, 09:32:35 pm
@MarkT:
Quote
An object sat on the surface of the earth experiences a 9.8m/s^2
_upwards_ acceleration.
True, but it also experiences a 9.8m/s^2 acceleration downwards due to gravity. The two balance out and so the object doesn't move.

Quote
The fact it doesn't appear to move due to this acceleration is because we are accelerating
with it.
No. We aren't accelerating and neither is the object. If we were accelerating we'd be moving.

There are two opposing forces on the object. The earth's gravity trying to pull it towards the centre of the earth and the force of the ground pushing it up by exactly the opposite amount. If the two forces aren't balanced, the object will be moving.

Quote
The fact that we stay the same distance from the centre of the earth is because
space is curved.
No. The curvature of space around earth is caused by the earth's mass and the result of the curvature is what we perceive as gravity.

Quote
An object in free-fall has zero acceleration
That is a contradiction. An object in free fall is, by definition, accelerating.

Pete
11  Using Arduino / Interfacing w/ Software on the Computer / Re: Send Data from Visual C++ to Arduino by UDP on: September 14, 2014, 09:50:30 am
Quote
No decoding would be needed if a union was used.
That's what I meant. The program could do the decoding instead of printing each byte as a decimal number and then decoding it by hand.

Pete
12  Using Arduino / Interfacing w/ Software on the Computer / Re: Send Data from Visual C++ to Arduino by UDP on: September 13, 2014, 10:01:17 pm
Decoding this packet:
65,86,73,79,0,0,0,1,0,0,0,154,0,0,0,0,

65,86,73,79 is the four ASCII characters AVIO
the next four bytes are the number of data packets which follow, and 0,0,0,1 is of course one packet.
That packet has a packet ID of 154 and the value is floating point zero.

Similarly, 65,86,73,79,0,0,0,1,0,0,0,154,63,128,0,0,
is AVIO with one packet with an ID of 154 and the floating point number is the 63,128,0,0 which would be easier to decode if it was printed by the program.

Pete
13  Using Arduino / Programming Questions / Re: Writing to EEprom using Wire on interrupt - Arduino freezing on: September 13, 2014, 09:06:49 pm
The Arduino only has one level of interrupt. When any interrupt occurs, interrupts are disabled until the code returns from the interrupt routine. There's no way to use anything else that relies on interrupts from inside an interrupt routine.
You have to do exactly as Jack advised.

Pete
14  Using Arduino / Interfacing w/ Software on the Computer / Re: Send Data from Visual C++ to Arduino by UDP on: September 13, 2014, 08:56:27 pm
This loop:
Code:
    for (int i = 0; i < packetSize; i++) {
      Serial.print(DATA_buf[i]);
    }
prints each data byte as a decimal number which will be from one to three digits. But there's no spacing between the value for each character so there's no way to interpret those numbers.
I would have printed each character as a hexadecimal number, but this will at least allow you to figure out the value of each character:
Code:
    for (int i = 0; i < packetSize; i++) {
      Serial.print(DATA_buf[i]);
      Serial.print(",");
    }

Pete
15  Using Arduino / Programming Questions / Re: Serial.read - How to parse serial input without delimiters on: September 13, 2014, 04:21:15 pm
Send the ZD command and then read the 24 chars into an array which will make it easy to pick off 6+7 and 8+9. You must also start a timeout so that if it takes longer than, say, one second and you still haven't received 24 characters from the ZD command, you ignore whatever you've just read, send the ZD command again and restart the timeout.
If you know how to compute the checksum it would be best to do that too and if it doesn't match you again ignore what you've just read and try again.

Pete
Pages: [1] 2 3 ... 113