Show Posts
Pages: 1 ... 130 131 [132] 133 134 ... 228
1966  Using Arduino / Sensors / Re: Interface with Axona Data Acquisition TTL on: June 26, 2012, 05:02:08 pm
Generally you would use digitalread to look at TTL values.
1967  Using Arduino / Project Guidance / Re: code/board interaction problem has me stumped on: June 26, 2012, 02:29:54 pm
I can't see anything wrong with your code, although I'd say you only need a single ms_active variable and let any of the detector ifs set it. It sounds as though one of your detectors is constantly reporting motion for some reason unrelated to the sketch. Put a serial.print inside each of those ifs so that you can verify it. If so, it looks like hardware or wiring.
1968  Using Arduino / Programming Questions / Re: Trying to reduce serial.print code on: June 26, 2012, 09:40:07 am
It's quite likely that using an array for those vin numbers would not only help here, but elsewhere in your sketch too.
1969  Using Arduino / Project Guidance / Re: Automatic engine/generator control on: June 25, 2012, 04:11:42 pm
The compiler is complaining that those variables aren't declared because you have made them local to setup. This should be better:
Code:
     int  glowPlug=8;    //sets glowPlug to pin 8
     int starter = 7;    //sets starter to pin 7
     int oilPres = 2;    //sets oilPress to pin 2

void setup()
  {
     pinMode(glowPlug, OUTPUT);   // initialize the glowPlug pin as an output (RED).
     pinMode(starter,OUTPUT);     // initialize the starter pin as an output (YELLOW)
     pinMode(oilPres,OUTPUT);     // initialize the engine oil pressure as an output (GREEN)
  }
 
 
 void loop()
 {         
    // for ( count = 1; count <= 3; count ++);
         
           digitalWrite(oilPres, HIGH);    //green LED turn on
           delay(800);
           digitalWrite(oilPres, LOW);    //green LED turn off
             
           digitalWrite(glowPlug, HIGH);  //red LED turn on
           delay(400);
           digitalWrite(glowPlug, LOW);   //red LED turn off
         
           digitalWrite(starter, HIGH);    //yellow LED turn on
           delay(300);
           digitalWrite(starter, LOW);    //yellow LED turn off
           delay (2000);
 }
 
1970  Using Arduino / Programming Questions / Re: How to move a servomotor to press a key? on: June 25, 2012, 03:26:09 pm
Rather than this:
Code:
nazza.write(nazzaPos - 2);

You need this:
Code:
nazzaPos -= 2;
nazza.write(nazzaPos);

Not compiled.
1971  Using Arduino / Project Guidance / Re: not quite sure where to put this but here is my problem on: June 22, 2012, 07:33:04 pm
Post the code you used to get the effects in your video - it looks like you have control of the individual leds pretty well there. To that end, it would be useful if you could describe what you'd like to do that you can't (yet).
1972  Using Arduino / Project Guidance / Re: How does digitalRead() determine if pin is HIGH or LOW? on: June 22, 2012, 04:02:46 pm
From the TTL wikipedia page:
Quote
A TTL input signal is defined as "low" when between 0 V and 0.8 V with respect to the ground terminal, and "high" when between 2.2 V and 5 V

You're going to need to condition your signal so that it falls in the 0-5V range. A voltage divider would do the job.
1973  Using Arduino / Project Guidance / Re: Digital Pin Protection on: June 22, 2012, 12:36:54 pm
The 40mA figure is the maximum any pin can sink or source without damage. It's up to you to ensure that that limit is not exceeded, so yes you'll need to provide a resistor. It's generally recommended that you don't push it right to the edge either - try to keep it to 20mA.
1974  Using Arduino / Programming Questions / Re: struct compilation issue on: June 21, 2012, 03:54:00 pm
I suspect that the compiler doesn't like you using Command for the tag and the new type.
1975  Using Arduino / Programming Questions / Re: Next item in array (rollover) on: June 21, 2012, 02:08:44 pm
sizeof returns size in bytes, so in your example, your array of 6 ints occupies 12 bytes. Hence, you have to divide it by the size of the first (or any other) element - two, to get the number of items it contains.
1976  Using Arduino / Project Guidance / Re: Atomated Still. Arduino making Whiskey on: June 21, 2012, 08:59:44 am
Since the flow from your tap varies, yes PID is eminently suitable. It can be tricky to tune the two PID parameters though. Your system may be simple/stable enough that you don't need anything more powerful than a simple feedback loop with a little hysteresis. Personally, I'd leave the PID out until your own control code starts getting too complex. OTOH, it might be a fun/useful learning experience.
1977  Using Arduino / Programming Questions / Re: Next item in array (rollover) on: June 21, 2012, 07:14:57 am
No. Your example is taking the size of a pointer (2 bytes on an arduino). A pointer is nothing but an address of a memory location - there is no extra information carried about what it's pointing to, such as the size of an array. Rob's example works because he is taking the size of an array that is known at compile time. Once you pass a pointer to that array to a function though, the function has no idea how large the array is.
1978  Using Arduino / Project Guidance / Re: Atomated Still. Arduino making Whiskey on: June 21, 2012, 06:36:53 am
Quote
ive been reading up on PID, the page you given me and others. But im not sure why i need it? A thermister will just out a change in resistance that i could measure with analogRead, i can map that to a temp range and use in my program. would that not be correct?

You can use a PID, but it's more useful when you can vary the controlling object proportionally. Since I assume all you're doing is turning the heater for the distillate on or off, you can, if desired, substitute the simpler approach you propose just as well.
1979  Using Arduino / Programming Questions / Re: Remove leading characters from char() on: June 20, 2012, 12:54:10 pm
You're going to have to post your code to get an answer to your question. Don't forget code tags (# button above).
1980  Using Arduino / Programming Questions / Re: sending file to arduino on: June 20, 2012, 12:10:44 pm
For 100 entries of 3 numbers each, assuming they fit in an int, that's 600 bytes. So unless you have other large demands on RAM, it should  be possible to hold it.
Pages: 1 ... 130 131 [132] 133 134 ... 228