Show Posts
Pages: 1 2 [3] 4 5 ... 244
31  Using Arduino / Programming Questions / Re: Trying to make a standalone signal system... on: June 26, 2014, 02:08:42 pm
Code:
        route + 1;
Does nothing.

Try
Code:
        route += 1;
32  Using Arduino / Project Guidance / Re: Whiskey dispenser on: June 26, 2014, 11:53:11 am
Check this out:
http://arstechnica.com/information-technology/2014/02/video-see-drinkmotizer-a-robotic-drink-mixer-make-long-island-iced-tea/
33  Using Arduino / Project Guidance / Re: minimal 24h weather forecaster on: June 26, 2014, 11:44:02 am
Quote
Do you think that it would be useful? 

Hard to say - what would you do with this forecast data if you had it?
34  Using Arduino / Interfacing w/ Software on the Computer / Re: Access to port is denied on: June 25, 2014, 12:51:14 pm
It sounds like the Arduino IDE and your VS program are both trying to use the same COM port. Close the IDE while you try to run the VS stuff.
35  Using Arduino / Interfacing w/ Software on the Computer / Re: Access to port is denied on: June 25, 2014, 12:02:49 pm
Do you have the Arduino IDE open & using COM3?
36  Using Arduino / Motors, Mechanics, and Power / Re: need help with water pump on: June 25, 2014, 10:11:22 am
Good point. Consider it a tip for a future accident  smiley-wink
37  Using Arduino / Motors, Mechanics, and Power / Re: need help with water pump on: June 25, 2014, 09:00:08 am
Note that if you're convinced that it's just the Atmel chip that blew, you can get a replacement more cheaply than a new Uno. One example: http://www.adafruit.com/products/123?&main_page=product_info&cPath=17&products_id=123
38  Using Arduino / Project Guidance / Re: Online data logger - Arduino requirements and quick start! on: June 25, 2014, 06:50:05 am
Take a look at these two links to get some ideas:

http://openenergymonitor.org/emon/
http://www.desert-home.com/p/test-html-code.html
39  Using Arduino / Programming Questions / Re: Most efficient way to send data to serial? on: June 24, 2014, 12:29:22 pm
Quote
My Arduino Uno has 2KB SRAM so it wouldnt handle that big array. It has 32 KB flash memory, though so I could store the data there.

You can't write to flash at runtime. People have reported getting faster baud rates than 115200 - try & see if you can get it going fast enough. Alternatively, consider using an arduino ethernet and send your data over UDP.
40  Using Arduino / Programming Questions / Re: Delay() or Not Delay(), that is the question. on: June 24, 2014, 09:33:20 am
Personally, my only use for delay is for debouncing, so in a teaching context, I'd agree that it's best to start with BWD and mention delay and its uses in passing.

However, if the person seeking help is just using the arduino as a means to an end or has no interest in learning coding skills I see no harm in using delay if it gets the job done. Best to warn them up front of the pitfalls of course.

To use a carpentry analogy, sometimes you don't want to go to the trouble of creating a beautiful dovetail joint when a couple of nails will serve for mounting your bird feeder.
41  Using Arduino / Programming Questions / Re: Trying to make a standalone signal system... on: June 24, 2014, 07:59:10 am
Try this for the flashing:
Code:
void setSignals()
{
for (byte n = 0; n < numSignals; n ++)
  {
  digitalWrite(signalPin[n][green], LOW);  // set all colours off
  digitalWrite(signalPin[n][yellow], LOW);
  digitalWrite(signalPin[n][red], LOW);
  if(colourOfSignal[n]==flred)
    {
    digitalWrite(signalPin[n][red], flash);
    }
  else
    { 
    digitalWrite(signalPin[n][colourOfSignal[n]], HIGH); // set one colour on
    }
  }
}

You will need to set flred to some other value, 3 perhaps. At the moment it's the same as red.
42  Using Arduino / Sensors / Re: New to this need some help with sensors on: June 24, 2014, 07:03:03 am
Any arduino can handle those requirements - most folks start with an Uno.

A popular temperature sensor is the DS18B20. There are waterproofed variants too, which might be nice in a greenhouse environment.

Opening a window can be managed in a number of ways obviously - Firgelli make some nice (but spendy) linear actuators. A stepper motor and a threaded rod assembly could do the same thing more cheaply. These things can't be powered directly from the arduino though.

Similarly, fans will need their own power and the arduino will just switch them on & off. The switching mechanism will depend on what voltage fans you're planning to use.


43  Using Arduino / Programming Questions / Re: Trying to make a standalone signal system... on: June 24, 2014, 06:20:49 am
Something like this:
Code:
void SetTurnouts(int RouteNumber,int t0,int t1,int t2,int t3)
{
posnTrackSwitch[0] = t0;
posnTrackSwitch[1] = t1;
posnTrackSwitch[2] = t2;
posnTrackSwitch[3] = t3;
Serial.print("Route "); 
Serial.print(RouteNumber); 
Serial.println(" Active"); 
}

It'll make your code a lot shorter, but it's less than ideal - if you ever add switches, it'll have to change as will all calls to it. I'd be inclined to make the system more data driven and have an array of structs containing the route numbers and corresponding turnout settings. Then the code would be simpler still and more resistant to change.

That can come later though - the last thing you need now (to echo Robin2) is more code without doing some testing & debugging of what you have.
44  Using Arduino / Programming Questions / Re: PIR activated relays on: June 23, 2014, 03:27:37 pm
The simplest way to do it would be to add a large delay after you turn the prop off. If the Arduino is supposed to be doing other things while waiting for the prop to be re-armed, delay will not do it & you'll need to use the blink without delay method instead. As the requirement is stated though, delay will get you going. Don't forget to put a UL suffix on the number of milliseconds you want to delay for.
45  Using Arduino / Programming Questions / Re: Trying to make a standalone signal system... on: June 23, 2014, 03:05:38 pm
You have a lot of repetition in your code. This:
Quote
    case 14:   
      posnTrackSwitch[1] = tun;
      posnTrackSwitch[2] = tun;
      posnTrackSwitch[3] = tur;
      posnTrackSwitch[4] = tur;
      Serial.println("Route 14 Active");
      break;
is copied, pasted and tweaked a number of times, which is bad news because it contains a bug. The indexes on that array run from zero to three - writing on the non existent element four is going to step on some other variable with likely confusing results.

Consider making a function which takes the route number and four parameters for the switch positions. It can do the Serial.print too. Some of your other copy/pasted sections could be simplified & shortened in a similar manner.

tur and tun look very similar; consider giving them names that are easier to distinguish at a glance.
Pages: 1 2 [3] 4 5 ... 244