Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Troubleshooting / Re: string replace? on: June 01, 2009, 08:47:06 am
Hi mem.

what I'm doing is reading xml lines from the web, and then try to get values from them.

example.
<data value="5"></data>

so I'd want to read the string and get back the number 5.
string replace seemed the easiest way. I could just remove the first and last part of the string and be left with only the number 5.

 @yenthefirst I completely appreciate your example I think I'm just not comfortable enough in arduino yet to fully understand it.
I'm coming from a php/actionscript background.
2  Forum 2005-2010 (read only) / Troubleshooting / string replace? on: May 25, 2009, 01:47:35 pm
does it exist? I could only find TextString which showed
void replace(char thisChar, char thatChar) - Replaces all the occurrences thsChar with thatChar

but I can't get it to work..

it errors for me.
I tried inString.replace(char* "<data value=", "");

and it says

error: expected primary-expression before 'char


I need to replace or find stuff as I'm trying to parse some xml..

thanks. sorry if this is a dumb question. I've been at it all morning and afternoon...
3  Forum 2005-2010 (read only) / Interfacing / Re: using a 4 digit LED number display? on: July 09, 2009, 02:23:43 pm
bah! nevermind!

simple delay(smiley-cool; between number chunks!

yay it works!
4  Forum 2005-2010 (read only) / Interfacing / Re: using a 4 digit LED number display? on: July 09, 2009, 02:03:08 pm
OK!
I can display digits seperatly using NPN transisotrs, and I ahve my arduino keeping count, and I have functions that turn on/off LED's to create numbers.

but how to I control the fast switching to generate the persistance of vision?

some example code of what I have that lacks that

 static unsigned long lastMilli = 0;

if (millis() - lastMilli >= 1000) {
lastMilli = millis();
second++;

}


if (second >= 60) {
minute++;
second = 0; // reset seconds to zero
}
  
  // move forward one hour every 60 minutes
if (minute >=60) {
hour++;
minute = 0; // reset minutes to zero

}

if (hour >=24) {
hour=0;
minute = 0; // reset minutes to zero
}

munit = minute%10;
hunit = hour%10;

then I control the numbers via



if(munit == 1){
   digitalWrite(11, HIGH);
  number_one();
}
else if(munit == 2){
   digitalWrite(11, HIGH);
  number_two();
}

etc.

but that clearly only works for the first digit, not the other 3.

pin11 is used as my transistor pin for the first digit.

pin 12 would be the next digit for going from 9 to 10

thanks for any help
5  Forum 2005-2010 (read only) / Interfacing / Re: using a 4 digit LED number display? on: July 06, 2009, 01:35:43 pm
ahhh multiplexing!
http://www.youritronics.com/seven-segment-display-explained/

and for any others wondering...

not sure if I have it hooked up correctly, but now I'm starting to understand the idea of it atleast.... having trouble getting the leds numbers to not all turn off though
6  Forum 2005-2010 (read only) / Interfacing / Re: using a 4 digit LED number display? on: July 06, 2009, 11:45:02 am
no idea what multiplexing is...
7  Forum 2005-2010 (read only) / Interfacing / using a 4 digit LED number display? on: July 06, 2009, 10:41:56 am
I have the following led display from sparkfun.
http://www.sparkfun.com/commerce/product_info.php?products_id=9214

trying to build a clock for fun.

the issue is I can only get it to display all the same numbers 33:33 44:44 etc...

has anyone used one of these before and have any pointers on how to get different numbers? the spec sheet got me as far as the base numbers, but I can't understand it well enough to see how to do multiple different ones.

thanks!
Pages: [1]