Show Posts
Pages: 1 [2] 3
16  Using Arduino / Programming Questions / Re: range finder and LEDs on: October 15, 2012, 08:52:13 am
Thanks Paul,
Sorry, to be clear- I'd like the lights to evenly fade up and down in their brightness when an object is at or beyond a defined distance. The effect is like how the Apple start button "throbs" up and down...
17  Using Arduino / Programming Questions / range finder and LEDs on: October 15, 2012, 08:40:37 am
I am controlling LED strip lights with a Maxbotic range finder and have the lights pulsing faster as an object gets closer (see code).
Code:
/*
* EZ rangefinder Distance Sensor
* prints distance and changes LED flash rate
* depending on distance from sensor
*/

const int sensorPin = 5;
const int ledPin = 13; //pin connected to LED

long value = 0;
int cm = 0;
int inches = 0;

void setup()
{
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}

void loop()
{
  value = pulseIn(sensorPin, HIGH);
  cm = value / 58;   // pulse width is 58 microseconds per cm
  inches  = value / 147;  // pulse is 147 microseconds per inch
  Serial.print(cm);
  Serial.print(',');
  Serial.print(inches);
 
  digitalWrite(ledPin,HIGH);
  delay(cm * 5);  //each centimeter adds 10 milliseconds delay
  digitalWrite(ledPin, LOW);
  delay( cm * 5);
  delay(20);
}

I'd like to have the lights "throb" if an object is outside of 5'..Do I use a switch statement? What is the best way?
18  Using Arduino / Project Guidance / Re: Tip 122 vs. ULN2003 on: October 15, 2012, 08:06:22 am
Thank you CrossRoads.
I ordered a very similar MOSFET to the one you suggested. I got the MOSFET-N-CH 60V 16A TO-220..I am going to post my schematic in a bit and would love for your input..
Thanks CrossRoads.
19  Using Arduino / Project Guidance / Re: Tip 122 vs. ULN2003 on: October 12, 2012, 09:17:52 am
Crossroads,
"How much currrent are you sinking?"....be patient with me..
P/V=I:  my longest length is 11.5' and about 17.25 watts at 12 volts. 17.25/12= 1.43 Amps (?)
(that is a question..) the other lengths will be shorter.
20  Using Arduino / Project Guidance / Tip 122 vs. ULN2003 on: October 11, 2012, 02:39:54 pm
I have a project that I need to control 6 lengths of LV flex strip LEDs independantly. I have seen and read about using a tip122 to switch the ground but I hav also seen a ULN2003 chip used; My longest length of lighting strip will be 11.5' which is about 17.25 Watts. Can anyone provide some benefits on either? or some suggestions to help?
Many thanks
21  Community / Gigs and Collaborations / Re: Interactive art installation- HELP on: October 09, 2012, 03:29:34 pm
I have.
I thought this was was for soliciting work opportunities.
22  Community / Gigs and Collaborations / Interactive art installation- HELP on: October 09, 2012, 02:11:32 pm
I have seen some related discussions, but I need help getting 6 seperate LED strip lights to be controlled by arduino via input from ultrasonic sensor. Example: the closer a person gets..the light pattern or speed changes..
Please help- deadline looming..
23  Community / Website and Forum / Arduino tutorials on: June 21, 2012, 04:21:35 pm
Just a friendly FYI to Arduino team:

I have encountered a few of the tutorials on the website that say one thing and show another in the Fritzing image. For someone like me who is a newbie and desperately trying to learn, it is a bit confusing. I have figured them out but it shouldn't be a quiz..although now thinking about it, it could help people learn to troubleshoot but I don't think that is the intension.
Most of the time it is a pin mis-placed or called out.
thanks
24  Community / Local Groups / Miami Arduino People? on: June 20, 2012, 06:28:44 pm
Anyone in Miami on this forum? I am looking to start a group but first want to see if there is anyone out there..
Message me personally if you want to get together.
25  Community / Gigs and Collaborations / programmer help on: March 30, 2012, 04:05:40 pm
I'm interested in having write some code for me. I am trying to learn how to do it myself but have too many things to make and not enough time.
The first one to sink teeth into is a simply using LEDs that can be cycled through different programs with a button
.. next will utilize an accelerometer to do similar things..
Relatively easy compared to some of the things I have seen out there.
I am on an Arduino Uno..
If anyone is interested, please message me privately.
Thanks community
26  Using Arduino / Programming Questions / Re: button plus switch/case scenerio on: March 07, 2012, 08:39:39 am
Wow, Thanks pYro_65..
That is way more complex than I thought it would be and introduces more for me to digest.. I'll have to spend some time on that one.
Did you write that on the fly?
27  Using Arduino / Programming Questions / button plus switch/case scenerio on: March 06, 2012, 07:54:04 pm
So, I am still learning. Any thoughts on how to combine this
Code:
const int LED = 13; //pin for LED
const int BUTTON = 7; //push button pin
int val = 0; //val used to store state of pin
int old_val = 0; //stores previous state of val
int state = 0; //0 = LED off and 1 = LED on
void setup () {
  pinMode(LED,OUTPUT); //LED is output
  pinMode(BUTTON, INPUT); //BUTTON is input
}
void loop (){
  val = digitalRead(BUTTON); //read input and store it
  //check transition
  if((val == HIGH) && (old_val == LOW)){
    state = 1 - state;
    delay(10);
  }
    old_val== val; //val is now old..store it
    if (state == 1){
      digitalWrite(LED,HIGH); //turn LED on
    }else{
      digitalWrite(LED,LOW);
    }
}
momentary button with a Switch/ Case function? The end result I'd like would be push button= LED goes on..Push button= LED blinks..Push button=throb....push button= off..
Any guidance from the community would be great
28  Using Arduino / Programming Questions / Re: Button/ help on: February 28, 2012, 07:21:18 am
Ah ha! Thank you PaulS et al!
I believe I got it..
29  Using Arduino / Programming Questions / Re: Button/ help on: February 27, 2012, 07:51:27 pm
ok, I give.
I had excellent input from which I have learned from...but...I can't get this to do what I want. I got the code to compile and circuit seems right, but when I try and cycle through programs, it will respond to a button push, but then revert back to what it was doing.

OK vague.
Goal: push button: start first program, push button: go to 2nd program, push button: got to 3rd program, push button: stop.
NOW: I have tried tinkering with it and lowering the "cases" to understand the system.
 I upload and it the LED blinks..then when I push the button it stops for a second...then starts blinking again..

Though I have had excellent input and advice, I still am at odds with this.

Is a momentary button not right for turning on a system-cycling through programs ans turning off??

Code:
int LED = 13;
int Button = 12;
int programState = 0;


void setup()
{

pinMode(LED,OUTPUT);
pinMode(Button,INPUT);
digitalWrite(Button,HIGH); //enable pull-up
}

void loop(){
if (digitalRead (Button)==0){ // assumes button declared as INPUT with internal pullup enabled
programState = programState +1;}
if (programState ==2){  // reset after 5, or whatever amount you select
programState = 1;

}
  switch(programState)
  {
  case 1:
 
  digitalWrite(LED,HIGH);
  delay (100);
  digitalWrite(LED,LOW);
  delay(100);
 
  case 2:
   
  digitalWrite(LED,LOW); //off
  }
}
   
30  Using Arduino / Programming Questions / Re: Button/ help on: February 27, 2012, 01:56:04 pm
 I believe that did it! I fixed it and more importantly, I learned!
 It compiled fine but I am at work and so I am dying to go home and see if it REALLY works..

Thanks Wild Bill
Pages: 1 [2] 3