Loading...
  Show Posts
Pages: 1 ... 10 11 [12] 13 14
166  Forum 2005-2010 (read only) / Interfacing / Re: Simple LCD Module Help? on: April 13, 2009, 06:39:30 pm
In my experience so far, I have noticed that if you don't clear before writing new information, it will leave the old characters in the blocks that are not written to.  For example, if one time you send "Hello World" to the LCD and the next time you send "Howdy", it does not delete " World" and would say "Howdy World" as hello and howdy have the same number of characters.  You could force it to write a space over the previously written characters, so that you would have a known character in each of the 16 spaces.  This is a bit cumbersome, but it works.  You may want to tell it to lcd.setCursor(col, row), just to make sure you know where it is going to write.
167  Forum 2005-2010 (read only) / Interfacing / Re: Simple LCD Module Help? on: April 13, 2009, 01:01:43 pm
When you clear the LCD, it will clear the screen and then reposition the cursor at 0,0.  This clears your message, "Barcode Scanned".  I have not done serial communication, but it appears from the serial reference pages that you need to assign the information being received by the arduino to a variable.  When you print, you print the variable.  In your loop, I believe it basically goes: Print "Barcode Scanned" -> Serial Available -> Yes -> Print the digit -> Serial Available -> Print the next digit...and so on.  From the reference page, if you use this, I believe you'll get the desired result:

int incomingByte = 0;      // for incoming serial data

void setup() {
      Serial.begin(9600);      // opens serial port, sets data rate to 9600 bps
}

void loop() {

      // send data only when you receive data:
      if (Serial.available() > 0) {
            // read the incoming byte:
            incomingByte = Serial.read();

            // say what you got:
            lcd.setCursor(0,1);
            lcd.print(incomingByte, DEC);
      }
}



Hope this helps.
168  Forum 2005-2010 (read only) / Interfacing / Re: Whole home temperature sensor suggestions on: February 15, 2009, 10:30:12 pm
If you want to do individual temperatures, you could use 10k resistors.  I work in HVAC and we use them all the time.  You can also do temperature averaging using 4 sensors; 2 sensors in series and paralled with another 2 sensors in series.  If your home isn't terribly large (less than 2,500 square feet) you can probably just use a single humidity sensor, unless you have a humidity problem in one particular area.  I think the SHT10 is a fine choice.  Our best controls use these.  Be aware that if you use them, you should only power them and take a reading every 6 seconds or more.  Any more often than that and you'll start to see some inaccuracies due to internal heating in the sensor.  It's buried in the sensirion datasheet.

Have fun.
169  Forum 2005-2010 (read only) / Exhibition / Re: Bathroom fan controller on: November 06, 2010, 07:41:10 pm
I've done some data logging in my bathroom in the morning when I get up to shower.  I've seen a 15% increase in RH in about 3 minutes.  You could just look for a sudden change compared a running average.  Not sure how often you should sample, but I think I was sampling about every 10 seconds.  I also used an RTC in my project -- DS1307.  My temp/humidity sensor is a Sensirion SHT-11.  
170  Forum 2005-2010 (read only) / Exhibition / Re: New, Easy, Arduino to shift register LIBRARY on: May 02, 2010, 09:07:02 pm
That's pretty interesting.  I'm more interested in the library than the shift register, though.  I don't quite understand how all the files go together.  Where is a good place to get some hand-holding on how building a library is done?  I may want to try it some day.
171  Forum 2005-2010 (read only) / Exhibition / Re: First project, temperature and light sensor on: April 24, 2010, 05:36:39 pm
Sounds like you're off to a good start.  You have some ideas and possible plans for your arduino project.  That's probably the best part, you get something going and then you build on it again and again, or at least until you run out of IO.  Then, you buy a Mega.  I'm not there yet, though.  smiley-wink
172  Forum 2005-2010 (read only) / Exhibition / Re: First project, temperature and light sensor on: April 24, 2010, 01:27:18 pm
That's pretty cool.  So are you going to use this to do remote monitoring of your home?  Will it eventually be used for home automation?
173  Forum 2005-2010 (read only) / Exhibition / Re: firefly night light on: November 06, 2009, 11:12:08 pm
I don't mind at all.  I don't consider this thread hijacked.  If there are other thoughts about how to make it more realistic or interesting in some way, I welcome the input.  What you're suggesting, however, is a little beyond me at this time.  I'm interested in seeing how your variation comes out, though.  Please keep me posted.
174  Forum 2005-2010 (read only) / Exhibition / Re: firefly night light on: November 06, 2009, 09:22:09 pm
There is a call to randomly choose which LED to light.  There is also a call to randomly choose how long to wait between blinks (from 1/2 second to 4 seconds).  Another call chooses how long the blink will last--this is the blink value.  It will wait for a few milliseconds between incrementing the time "i".

You can play around with any of these values to get the affect you want.  If you don't want a fade to black between the two values, you can change the blink delay value to 0.  They would immediately light one after another.  Does this answer your question?
175  Forum 2005-2010 (read only) / Exhibition / Re: firefly night light on: June 16, 2009, 06:08:37 am
I was just brain storming and thought of a way to use all of the outputs on my Arduino for fire flies.  I could use one PWM output to control the fade rate of the LED.  All other outputs would be tied to transistors and LEDs.  I would wire them as common Anode so that I could light any one of 19 fire flies, instead of only 6.  Basically, I'd be multiplexing the outputs.
176  Forum 2005-2010 (read only) / Exhibition / Re: firefly night light on: June 16, 2009, 06:01:26 am
I haven't decided exactly what the end result should look like.  The bugs in a jar is good, and I've seen some video of it.  I had also thought of getting a small sheet of wood or something and then putting the LEDs through holes in that.  I'll post some more pictures and/or video when I've figured it out.
177  Forum 2005-2010 (read only) / Exhibition / Re: firefly night light on: June 15, 2009, 09:50:11 pm
Here's the video.  Please give me your comments.

[media]http://www.youtube.com/watch?v=NIoIsmw5_gc[/media]
178  Forum 2005-2010 (read only) / Exhibition / firefly night light on: June 15, 2009, 07:13:01 am
I've written a program to "look" like fireflies blinking in my kid's room.  It's a pretty simple program and I had a little help, but it works pretty well.  I thought I'd share with anyone who enjoys seeing them in the summer.  They started coming out about a week ago in central Indiana.  have fun.
I used the PWM outputs and a cosine function to vary the duty cycle for a smooth increase and decrease in brightness.

Code:
/*This sketch is intended to approximate the blinking of fireflies.  It varies the delay between
blinks and varies the total blink time.  I've used the random() function to vary which PWM  output
is chosen for the next blink.
Hope you get some enjoyment out of it.  I created it as a fun night light for my kids.
Chad Richardson -- Chad@ChadsCustomWood.net
*/


int value;
int pwmPin = 11;                    // light connected to digital pin 11-- I just chose an initial value
//int ledpin2 = 9;
long time=0;
int period = 500;
int i = 0;
long blink_delay = 1000;            // these must be declared as long due to the random() operation
long blink = 3;
long random_led = 55;
const byte pwmPins [] = {3, 5, 6, 9, 10, 11};

void setup()
{                                    //nothing to setup
}

void loop()
{
  choose_firefly();
  fade();

  blink_delay = random(500, 4001);
  delay(blink_delay);  
  blink = random(2, 5);  
  
}
void fade()
{
  for(i=0; i<255;)
  {
    time = i;
    value = abs(-127+127*cos(4*PI/period*i));            //the -127 value shifts the cosine curve negative with a zero initial value; abs shifts everything positive
    analogWrite(pwmPin, value);           // sets the value (range from 0 to 255)
    delay(blink);
    i++;
  }
}

void choose_firefly()
  {
    pwmPin = pwmPins [random (0, 6)];  
  }
179  Forum 2005-2010 (read only) / Exhibition / Re: Analog keyboard-7buttons for only an analog input on: February 10, 2010, 12:33:08 pm
I toyed with the idea of doing this.  I even went so far as to work up an Excel spreadsheet to calculate values and voltages so you could choose what size resistors you wanted.  It's still a manual process, but you can see the expected voltages when you push a certain button.  I was trying to maintain a fairly equal separation in voltage between each of them.  If you'd like the spreadsheet, PM me and I'll e-mail it to you.
180  Forum 2005-2010 (read only) / Exhibition / Re: Wi controlled Lego gun turret on: January 23, 2010, 03:32:06 pm
That's a cool project.  Are you controlling with the accelerometer?  Are you able to use the stick, if you preferred?  I've been thinking about maybe building a jog control for my cnc using a nunchuck.
Pages: 1 ... 10 11 [12] 13 14