Show Posts
Pages: 1 ... 36 37 [38] 39 40 ... 99
556  Using Arduino / Programming Questions / Re: Pointers problem. on: January 22, 2014, 02:00:37 pm
Your basic problem is that you are not allocating any space for storing your strings.

In general, any time you see var = "constant" in C, there is probably a bug somewhere unless it is a declaration and initialization.

You need to do this:
Code:
// Allocate *space* for char arrays
char filepath[32];
char filename[16];
char extension[16];

//...

strcpy(filepath, "index.htm");

string constants like "index.htm" are not writeable, they should be considered read only memory. strtok() wrote a '\0' into your constant string.
557  Using Arduino / Programming Questions / Re: USB microphone on: January 22, 2014, 01:51:52 pm
The whole point of USB was "keep the hardware simple and move as much to software as posssible", which should answer your question.

There is a tutorial an the site here that describes how to program the USB chip on a UNO to be a midi device instead of a serial device, that might start you in a direction.
558  Using Arduino / Programming Questions / Re: Is there an issue with c string pointer arithmetic in Arduino? on: January 22, 2014, 12:34:19 pm
You seem to be mixing Strings and strings.

In any case, strncpy() does not guarantee a zero terminated string.
559  Using Arduino / Programming Questions / Re: Finally some sense writing assembly code in a sketch, or is there? on: January 22, 2014, 11:53:35 am
This might be an actual application for Duff's device:
http://en.wikipedia.org/wiki/Duff's_device
560  Using Arduino / Programming Questions / Re: Any way to input float in scientific notation? on: January 21, 2014, 06:53:24 pm
Write your own parser, it is not really all that hard.

You also have atof() in stdlib.h
561  Using Arduino / Programming Questions / Re: multiplication/division question on: January 21, 2014, 03:00:34 pm
I don't think you want to shift by 2048 positions. 8^)

Don't you mean 11 here?
562  Using Arduino / Programming Questions / Re: Interrupt performance? on: January 20, 2014, 05:18:40 pm
What you are doing sounds fine, but you will have some minimum reading - you can never get to zero since you have to wait for the first ISR to finish before you can wait for the next one.

I would tend to do it in hardware. Set your comparators to start/stop a counter and after the second comparator fires, read the counter value. By setting the clock rate to the counter you can change resolution as desired, say if it overflows.
563  Using Arduino / Programming Questions / Re: Why are this code destroying the bootloader?? on: January 20, 2014, 01:51:57 pm
And HugoPT, my understanding was that the !!! put the arduino bootloader in some sort of console/debug mode, stopping any download dead in its tracks.
564  Using Arduino / Project Guidance / Re: does the symbole +- exist in arduino on: January 20, 2014, 01:49:31 pm
Does that "symbol" exist in any other language? Not that I am aware of, though it might exist in APL.
565  Using Arduino / Programming Questions / Re: Argg... I Forgot So Much on: January 20, 2014, 12:38:26 pm
To add to Rob's comment.

Excessive commenting like that is actually bad. If you have something like this:
Code:
// Set pinswitchmode to 42
pinswitchmode == 42;

The comment can blind you to the fact that you did *not* set pinswitchmode to 42. Some experts actually suggest that you write all your comments on the right hand side of the page so that you can cover them during debugging and not be subtly influenced by what they say.
566  Using Arduino / Programming Questions / Re: Why are this code destroying the bootloader?? on: January 20, 2014, 12:34:00 pm
It generally prevents uploading. And the "!!!" could occur anywhere in the code. It is probably not your problem.
567  Using Arduino / Programming Questions / Re: Why are this code destroying the bootloader?? on: January 20, 2014, 11:28:15 am
Why do you think it is the bootloader?

Can you reload blink? If so, it is not the bootloader.

Are you getting any serial output?

It was hard to tell, do you have any "!!!" in your code?
568  Using Arduino / General Electronics / Re: So to use opto-coupler I need 2 separate power supplies ? on: January 20, 2014, 10:09:05 am
Capacitors, lots and lots of capacitors.

I used optoisolating triac drivers for controlling some slide projectors microprocessor based multimedia controller. While the low voltage electronics and the projector bulbs were connected by the same AC line, the electronics were isolated by a transformer, so there was no wire connection between the low voltage electronics and the mains, making it much safer to work on.
569  Using Arduino / Programming Questions / Re: List of Variables and memory space/usage on: January 20, 2014, 09:18:50 am
The compiler can do that if you tell it to, look up bit fields, and promptly forget them.
570  Using Arduino / General Electronics / Re: Ac vs DC on: January 20, 2014, 09:17:38 am
Yeah, because a 100% duty cycle is DC.
Pages: 1 ... 36 37 [38] 39 40 ... 99