Loading...
  Show Posts
Pages: 1 ... 9 10 [11]
151  Using Arduino / Project Guidance / Re: Science Fair Project on: November 19, 2012, 10:55:04 pm
Hi matt02510,

Welcome to the forum!  This project sounds fascinating.  I'm sure you will find a lot of help here, but first we'll need some more detail on your plan:

  • Do you have the electromagnets yet? How many?
  • How are they controlled?
  • Specifically what types of sensor will you use?
  • Are you making your own sensors?
  • Will you need one sensor per magnet?
  • ...
   
There are many online resources for sensors (I've used Jameco.com). 

There are also a number of available relay boards (http://www.sainsmart.com/16-channel-12v-relay-module-for-pic-arm-avr-dsp-arduino-msp430-ttl-logic.html for example) that can be used to control high current draw items such as your magnets.

-Pat
152  Using Arduino / Programming Questions / Re: Random() on: November 19, 2012, 07:43:06 pm
Hi iluvplanes,

There seems to be a few other discussions happening here...  I'll try to address your comment:

Quote
What the code does is flash each LED once, making sure that each is flashed only once.

If you are happy with your code, then ignore me...  But I believe your software won't do what you wanted.  (1) the way you check for repeated random numbers wont guarantee that an LED wont repeat (walk through your code with the sequence: 2 3 2 3) and, (2) the whole thing is in a loop, so this will all happen more than once.

Just trying to help. I hope I'm not being too picky!
153  Using Arduino / Programming Questions / Re: Random() on: November 18, 2012, 11:40:39 am
Hi iluvplanes,

Just a few coding observations that can make your code easier to read and easier to understand:

You have 2 delays, 3 sec at the beginning of your loop and 1 sec at the bottom of the loop, that can be combined into a single delay.

// Comments help to explain what you are doing. I had to read through the code to determine the following:

It appears that you have a loop cycle time of 6.8 seconds when you add all of the delays.  Within this time you would like to randomly flash some LEDs for 0.7 seconds.

From your code, it appears that you can flash an LED multiple times in the cycle--just not twice in a row, and that within a cycle it is ok if an LED doesn't flash at all. If not, then Nick's shuffle approach is the way to go.

That said... This was probably just supposed to be a fun activity and now that you've gotten it to work, you can move on to other things!  FUN, FUN, FUN.  If you're looking for something to tweak (and something to learn), maybe use potentiometers to vary the loop delay and on/off delays?
154  Using Arduino / Programming Questions / Re: Programming Question..? on: November 18, 2012, 10:58:10 am
Wildbill is correct about readability. Along those lines, you should also use constants to declare the control limits, something like:

Code:
const int FAN_ON_TEMP = 75; // turn fan on at 75 degrees Fahrenheit
const int FAN_OFF_TEMP = 73; // turn fan off at 73 degrees Fahrenheit

And use those constants in place of the literal values in the code.
155  Using Arduino / Programming Questions / Re: Programming Question..? on: November 18, 2012, 01:57:59 am
Quote
In order for the fan to turn off, you have to tell it to turn off.

As Arrch says, you are missing some logic.

Also, it is common in situations like this to add hysteresis (en.wikipedia.org/wiki/Hysteresis) and make the "turn off" temp lower than the "turn on" temp to keep the fan from turning on and off too quickly.

Maybe something like:

Code:
if(fTemp <= 73)
 digitalWrite(pin2, LOW);
156  Using Arduino / Programming Questions / Re: All pins unused pins HIGH? on: November 14, 2012, 08:30:57 am
Quick side note... I'm fairly new to these forums too, and have been looking for guidance and instructions on how to post correctly. The site is large, and I haven't found anything yet -- am I looking in the wrong spots? Can you direct me to the right spot?  Thanks!

Also, I thought unused pins are set to input and were pulled high by default.

Edit: interesting... Just after posting this, I saw the 'read this first...' link you mentioned (I did look before posting this, by the way).  It wasn't there when I looked earlier ?! Maybe I inadvertently set a filter. Hmmm
157  Using Arduino / General Electronics / Re: Can I build a project using 4 AA batteries with a 5V Arduino board? on: November 14, 2012, 07:45:07 am
Thanks for the link.

Is this a problem caused by the constant low voltage driving the regulator (4v into a 5v input),or is it due to the fact that the batteries will lose V over time and drop below a minimum threshold?

Sometimes I power mine with a 5v phone charger that way and want to make sure I'm not doing anything foolish.
158  Using Arduino / General Electronics / Re: Can I build a project using 4 AA batteries with a 5V Arduino board? on: November 13, 2012, 10:42:21 pm
Quote
An Arduino will run off (eg.) 4V connected to the "5V input" pin (ie. bypass the regulator)
I wouldn't recommend this with latest versions of Arduino.
The regulator is sensitive to being reverse driven.
Add a diode from 5V (anode) to Vin (cathode) to prevent damaging the regulator.

Can you elaborate on this a little?  What does the diode protect, and how? Especially in a battery driven case.
159  Topics / Interactive Art / Re: Mechanic drum robot installation MR808 – TR-808 robot replica on: November 13, 2012, 10:00:00 am
Very cool.

Now I'm thinking that my Christmas song handbell project will be pretty lame in comparison :-(

Did you use any servos, or just solenoids?
160  Using Arduino / Project Guidance / Re: Song for Arduino, and instructions (Easy project with code included) on: November 12, 2012, 09:46:07 pm
Thanks for the code -- We adore thee too!
161  Community / Bar Sport / Re: Does "arduino" means something? on: November 03, 2012, 09:35:59 pm
From what I recall, the product was named after the cafe that the designers frequented when they were developing it.  The cafe was named after a medieval king that ruled the region.
162  General Category / General Discussion / Re: So who's got the coolest Halloween project? on: November 02, 2012, 11:31:59 am
Ha! That's the scariest!  smiley-twist
163  General Category / General Discussion / So who's got the coolest Halloween project? on: October 31, 2012, 08:31:35 pm
I put a PIR sensor in a pumpkin nose and triggered a spooky recording. I hope to do more next year.  Anyone else?
Pages: 1 ... 9 10 [11]