Show Posts
Pages: 1 2 3 [4] 5 6
46  Using Arduino / Programming Questions / Re: "program" inside program on: March 16, 2012, 03:41:48 pm
You might want to try searching for "implementing state machine" as a start for some interesting info.
47  Using Arduino / Programming Questions / Re: Problem handling text on: March 08, 2012, 04:21:52 pm
A couple of things:

1. I'm not sure you can do command[0] = Serial.read().

You probably want command.setCharAt(0, Serial.read()).

2. Serial.read is probably going to return a signed integer, and I believe String treats its characters as unsigned bytes, so you'll have to make sure to convert. If no character is available, Serial.read() will return -1 - so you probably want to check for that as well.
48  Development / Other Software Development / Re: Bypass bootloader at runtime on: March 01, 2012, 06:10:33 pm
Here's something that might help:

http://arduino.cc/en/Hacking/Programmer

Essentially, if you can burn a bootloader with something (either a dedicated programmer, or second Arduino as a programmer), you can burn your code to the same place.

(On reflection, now I'm thinking that you're talking about the USB detection. Maybe this:
http://www.instructables.com/id/Turn-your-Arduino-Uno-into-an-USB-HID-Mididevice/
will be closer to what you're looking for?)
49  Using Arduino / Project Guidance / Re: Control the speed of a small servo motor and LED brightness fade over 5 minutes? on: February 29, 2012, 06:04:59 pm
Pretty much any LED and a current-limiting resistor are all you need for LED components. Here's a link:
http://sheepdogguides.com/arduino/aht0led.htm

You'll probably want to use a pin that can do pulse-width modulation (PWM) to dim the LED - there are 255 steps to choose from, so you could either increment by 1 every 1176 ms (approx) or go from 0 to 249 every 1200 ms and then go straight to 255 for full brightness.

Motors would be similar - but I have no recommendations for hardware for motors; never used 'em.
50  Community / Bar Sport / Re: why do magnets make bigger sparks? on: February 16, 2012, 01:06:54 pm
Do the sparks change if you turn the magnet around? If they do, sounds electromagnetic. If not, maybe the composition of the magnet instead?
51  Community / Exhibition / Gallery / Re: my arduino project on: February 09, 2012, 05:01:39 pm
Nifty stuff! It looks like you've spent a lot of time working on this, and it shows (in a good way!)
52  Using Arduino / Programming Questions / Re: Can you use something like #ifdef to check if a header file is included? on: January 24, 2012, 06:21:34 pm
Yes, if the header file defines something unique. (Most do so in their guard code.)

In other words, most headers will have the form:

Code:
#ifndef __SOME_UNIQUE_THING_H
#define __SOME_UNIQUE_THING_H
...
#endif

So you would put the following in your code:

Code:
#ifdef __SOME_UNIQUE_THING_H
// Must be using SomeUniqueThing library
#endif

If they don't have that, you can look through the header for a #define that is "pretty unique" to that header and test for that. Failing that, I don't know any other easy way. Be wary of different versions of the same libraries, too.
53  Using Arduino / Project Guidance / Re: La Crosse wireless sensors on: January 06, 2012, 06:24:06 pm
The book "Practical Arduino" had a chapter on LaCrosse weather stations... try here:
http://www.practicalarduino.com/projects/weather-station-receiver
54  Using Arduino / Programming Questions / Re: newbie altering existing sketch on: December 20, 2011, 07:10:14 pm
This looks suspicious:

  // attach interrupt to reed pin
  attachInterrupt(1, rotation, FALLING);

That says to make use of the interrupt on pin 3. If you don't have pin 3 wired up to the reed switch, you won't be getting the interrupt.

Here's some more detail:
http://www.arduino.cc/en/Reference/AttachInterrupt
55  Using Arduino / Programming Questions / Re: Reason for missing new() / delete()? on: October 03, 2011, 05:45:19 pm
The sense I get is that if you're writing a library, you should use malloc/free (and in fact, you may have to, since new/delete are gone). If you're writing a sketch for a particular purpose (i.e., the majority of Arduino developers), you should use singleton variables or fixed-size arrays, and not malloc/free/new/delete.

I'm not saying I agree with the decision to remove new/delete - but I can see that at least it makes you pause before going forward.
56  Using Arduino / Installation & Troubleshooting / Re: UNO not saving sketch after power cycle on: October 03, 2011, 05:03:35 pm
Maybe this will help?

http://forums.adafruit.com/viewtopic.php?f=25&t=21752

57  Using Arduino / Programming Questions / Re: Dallas Temperature Sensor on: September 30, 2011, 06:08:58 pm
In C/C++, you can initialize arrays with a list only when you define the array. So

Code:
int insideThermometer[] = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };

is valid, but:

Code:
int insideThermometer[8];
insideThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };

is not.

Initialization from a list is something the compiler does. The compiler actually does the initialization in the first case by reserving the memory and filling in the values at the same time. The compiler can't do anything in the second case - the memory for the array has already been allocated, so a change would have to happen at runtime.
58  Community / Website and Forum / Re: More Sticky? on: September 30, 2011, 05:17:40 pm
While we're nominating good stickies, I'd suggest:

http://arduino.cc/forum/index.php/topic,53290.msg380874.html#msg380874

(how put the V1 Uno into DFU mode the "easy way".)
59  Using Arduino / Microcontrollers / Re: Updating the Atmega8U2 -> Invalid HEX file syntax on: September 26, 2011, 03:16:51 pm
I did this a while back. These instructions might help:

http://andrewmemory.wordpress.com/2011/04/14/upgrading-the-arduino-uno-8u2-using-flip/
60  Using Arduino / General Electronics / Re: Moving from breadboard to perfboard on: September 26, 2011, 03:14:02 pm
Thanks for the advice. I think I'll need to start thinking of Vcc and Gnd as "just one more thing to connect" rather than special lines.

Veroboard looks like a good idea, but I've never seen it available for a reasonable price. If I do I'll give it a try :-)
Pages: 1 2 3 [4] 5 6