Show Posts
Pages: 1 ... 97 98 [99] 100 101 ... 247
1471  Using Arduino / Programming Questions / Re: Changing function state from inside a if-loop? I'm a little bit stuck here... on: April 09, 2013, 01:40:56 pm
Oh yes, LCDMode immediately puts it back. Try this there instead:
Code:
LCDMode = 1;

Not a pretty solution though.
1472  Using Arduino / Programming Questions / Re: Changing function state from inside a if-loop? I'm a little bit stuck here... on: April 09, 2013, 01:26:06 pm
Could it be as simple as setting mode to 1 after this?
Code:
    delay(40); //reset pulse
1473  Using Arduino / Project Guidance / Re: Newbie Needs help!!! on: April 09, 2013, 12:16:47 pm
How long does the vehicle take to stop, or what is the stopping distance? From 5mph, it may be stopping so quickly that you'll need multiple magnets on the wheel to establish the deceleration in tim to light the leds.

Edit: spelling
1474  Using Arduino / Project Guidance / Re: Combining code to make a new Program on: April 09, 2013, 09:48:52 am
It looks like a little tweaking would get it to compile at least. You appear to have pasted versions of setup and loop into the middle of your freeRam function - move them up above it. Then you'll have the issue of having two versions each of those two functions, so you'll need to combine them. Copy everything from the smaller versions into the larger and delete the original.

Both setups setup the serial port, only need one.

In the remaining loop, just run the decode function for now. Observe what it returns through the serial port when you press a particular button. Test for that & then add the code you have that plays a wave file.

I suspect that this last bit will be a struggle. You should be able to get a lot closer to a compilable program though. Post that version and any errors you get if you get stuck.
1475  Using Arduino / Programming Questions / Re: Reading the Arduino SD Card on: April 08, 2013, 06:21:26 pm
The only way you're going to get your file to the Pi is to read it and send it to the serial port - there's no built in facility on the Arduino to do it for you. You'll need some software on the receiving end too. However, I did notice this in the playground: http://playground.arduino.cc//Code/FTP

Disclaimer - I've never used it, nor did I give the code more than a brief perusal. Check it out; might give you some clues at least.
1476  Using Arduino / Programming Questions / Re: No serial output on: April 08, 2013, 06:15:02 pm
The issue is not the size of your source file, it's how much RAM your sketch is consuming at runtime. Judicious use of the F macro, as suggested above, should avoid the necessity to buy a Mega.
1477  Using Arduino / Programming Questions / Re: Reading the Arduino SD Card on: April 08, 2013, 10:39:16 am
Can you send "hello world" kind of things using Serial.print and receive them on the Pi?
1478  Using Arduino / Programming Questions / Re: Receiving weird results with 4 DS18B20 digital temp sensors??? (85 C, -127 C...) on: April 07, 2013, 10:39:47 pm
The resistance. The cable length adds it and so, if you're forced into long runs, a way to compensate is to reduce the size of the primary resistor.
1479  Using Arduino / Programming Questions / Re: Receiving weird results with 4 DS18B20 digital temp sensors??? (85 C, -127 C...) on: April 07, 2013, 04:35:40 pm
There's only supposed to be one pullup resistor, not one per DS18B20. Also, for longer runs, you may want to make it a bit smaller.
1480  Using Arduino / Project Guidance / Re: 3D Printer Advice on: April 07, 2013, 03:49:51 pm
There's no magic in RAMPS. You can certainly drive the device from an Arduino without it. RAMPS interfaces to a Mega, presumably to get more pins  but you could probably do it with an Uno too depending on how many pins your design requires.
1481  Using Arduino / Programming Questions / Re: char array to unsigned short array on: April 07, 2013, 11:02:00 am
You can use a pointer and point it to your existing array thus:
Code:
char image[10];
unsigned short *im = (unsigned short*)image;

And then operate using the pointer instead. You may have endian issues to overcome though.
1482  Using Arduino / Programming Questions / Re: char array to unsigned short array on: April 07, 2013, 10:19:34 am
On an arduino, I doubt that it can. An unsigned short occupies two bytes and an array of that size wouldn't even fit on a mega. On a machine with more memory, a simple for loop would suffice. From the names, you imply that you're trying to do some image processing. Generally, the arduino has too little memory and is too slow for such applications.
1483  Using Arduino / Programming Questions / Re: Making a Sensor Light With Preset Timer Function on: April 07, 2013, 07:49:12 am
The easiest way would be to use delay after you turn the led on. If your system will expand later to do other things, you'll want to do your timing with millis. Look at the blink without delay example sketch provided with the IDE to see a simple example of controlling a led using millis.
1484  Using Arduino / Programming Questions / Re: Receiving weird results with 4 DS18B20 digital temp sensors??? (85 C, -127 C...) on: April 07, 2013, 07:43:08 am
After the 85 readings, you're getting more precision, which suggests that the device reset and reverted to 12 bit precision. Which could well be a power issue. Are you running long cables to these sensors?
1485  Using Arduino / Programming Questions / Re: Halo project compile errors on: April 06, 2013, 08:51:14 am
This:
Code:
void Ping3:fire()
should be this:
Code:
void Ping3::fire()
Pages: 1 ... 97 98 [99] 100 101 ... 247