Loading...
  Show Posts
Pages: 1 [2] 3 4 ... 36
16  Using Arduino / Programming Questions / Re: RTCLib parsing on: December 09, 2012, 10:08:20 am
Thanks Nick.  So I've used sprintf, but am unclear how to get the last character.
This is what I have so far.  How do I get the last character out ?

Code:
int parseMinutes()
{
 DateTime now = RTC.now();
  char buffer [10];
  int n;
  int a =now.minute();
  n =sprintf (buffer, "%d", a);
  Serial.print("Buffer = ");
  Serial.print(buffer); 
  int len = strlen(buffer);
  Serial.print(" length = ");
  Serial.println(len);
}

Results for say 9:15 are -
Quote
Buffer = 15 length = 2
17  Using Arduino / Programming Questions / RTCLib parsing on: December 08, 2012, 03:55:46 pm
Hi,
I'm trying to get the minutes from an RTC using RTCLib to use with a 7 segment display.  Everything else is already working, I just need the minutes  I've got the 10 spot working using a long handed version, but need the ones spot.
Code:
// Minutes
 if(now.minute()>=10)
 {
  matrix.writeDigitNum(3, 1);
 }
  if(now.minute()>=20)
 {
  matrix.writeDigitNum(3, 2);
 }
  if(now.minute()>=30)
 {
  matrix.writeDigitNum(3, 3);
 }
  if(now.minute()>=40)
 {
  matrix.writeDigitNum(3, 4);
 }
  if(now.minute()>=50)
 {
  matrix.writeDigitNum(3, 5);
 }
  if(now.minute()<=9)
 {
  matrix.writeDigitNum(3, 0);
 }
For the ones spot, this method would be far too long.
What I've got for the ones spot so far is:
Code:
for(int x;x<=59;x++)
 {
   if(now.minute() ==x)
   {
     matrix.writeDigitNum(4, x);
   }
 }
Obviously this only works in some cases.  Is there an easy way to parse out the one spot minutes.  For example, how do I get the 2 out of 11:52?
Thanks
18  Using Arduino / Project Guidance / Re: Single instance button press on: December 02, 2012, 08:11:59 am
I would add a counter.  Something like this (untested).
Code:
int value=0;
int button1=5;
int x=0;
void setup()
{                 
}

void loop()
{
  int val1=digitalRead(button1);
  if (val1==LOW)
  x++;

  if (x == 1)
  (value=value+5);

if (val1==HIGH)
  x=0;
}
}
19  Using Arduino / Project Guidance / Re: RGB LED Mounting Ideas on: November 29, 2012, 06:47:11 am
Thanks DVDdoug, I'll give those a try.
How are you connecting the LED to your board? 
Are you just permanently soldering a wire or using some kind of connector?
20  Using Arduino / Project Guidance / RGB LED Mounting Ideas on: November 28, 2012, 07:46:49 pm
Hi,
I'm making a project that has 8 RGB LEDs.    My method for attaching / inserting them leaves something to be desired. I've drilled holes in my box top and inserted those little round black LED holders.
I'm then using crimp connector housing http://www.pololu.com/catalog/product/1901 along with the crimped wires http://www.pololu.com/catalog/product/1800
I've soldered one end of the wires onto my proto board and  put the connector housing onto the other end.  This end is connecting directly to the 4 prongs of the RGB LED.

Originally I was looking for a way to make sure everything was removeable in case anything failed.  My method is too cumbersome and can be prone to the connector coming off.

How do you attach RGB LEDs to your project?
Suggestions for my next project?



21  Using Arduino / Project Guidance / Re: Ideas for finger pad switches on: November 20, 2012, 12:59:33 pm
Something like an FSR (Force Sensitive Resisitor) might work too.
http://adafruit.com/products/166
22  Using Arduino / Project Guidance / Re: interfacing webcam on: November 20, 2012, 11:38:06 am
You might try a program called GoBetwino, to go between Arduinio & the computer.
http://arduino.cc/playground/Interfacing/GoBetwino
23  Using Arduino / Project Guidance / Re: No restart on UNO after power down on: November 19, 2012, 02:08:27 pm
Sounds like a power issue.
How did you wire this up?
Are you powering ther motor from a different power source or through the Arduino?
24  Using Arduino / Project Guidance / Re: Communication device using arduino on: November 16, 2012, 03:46:54 pm
Something to think about..
I saw another project (can't remember where now) where an object would either email or send you a text message when used.  Imagine a coffee pot that sends you an email every morning.  If placed in the elderly persons house, it signals that they are ok and have gotten up.  No email or txt message signals a possible problem. 
While I like this idea as the person does not have to wear a bulky device, the problem is deciding what does that person do every day to trigger a message.  Other triggers might be opening the fridge door or flushing the toilet.
25  Using Arduino / Project Guidance / Re: Simple counting/increment per iteration on: November 08, 2012, 04:23:20 pm
See if this is easier to understand. Code is not tested.

Code:
int count = 0;
void setup(void) {
}

void loop(void) {
 count++;
 if (count <=8) // change 8 to number you want
 {
 ledSequence();
 }
}

void ledSequence()
{
  //do stuff here
}
26  Community / Bar Sport / Re: Arduiono UNO "holder" (for want of a better term) on: November 07, 2012, 12:00:04 pm
Neat idea.  I wonder if the file is available on Thingiverse for 3d printing.
Where did you find it?

27  Using Arduino / Project Guidance / Re: How to ID Various Objects on: November 06, 2012, 12:46:36 pm
Just a thought, but if you only had 1 slot you could use an RFID reader.
Put 1 block in and take it out, then block 2, until you have done this 5 times.
Then sounds play.
http://adafruit.com/products/789
28  Using Arduino / Project Guidance / Re: digital speedometer help :) on: November 02, 2012, 03:26:50 pm
Connection - wires, LCD and stuff
Code -
Code:
void setup() {               
 //do stuff here   
}
void loop() {
  //do stuff here too
}
29  Using Arduino / Project Guidance / Re: Advice for a simple project - N00b on: November 02, 2012, 02:21:53 pm
Sorry I've never used either sensor.
I would ask Sparkfun.
30  Using Arduino / Project Guidance / Re: Creating Soundboard with mp3/wave files in Processing on: November 02, 2012, 02:08:23 pm
Playing a pre recorded sound on an Arduino requires a shield like this one.
http://adafruit.com/products/94

You can also play tones.
http://www.google.com/url?q=http://www.arduino.cc/en/Reference/Tone
Pages: 1 [2] 3 4 ... 36