Go Down

Topic: string library ? (Read 1 time) previous topic - next topic

mrbbp

Well i want to make a small text generator with an arduibo board and lcd display but i discovered that there no implementation of evolved "string" instruction, like "split" or "substr" or string array in arduino langage (same thing in processing or wiring)
is there a way to add this functions in arduino or is it to heavy for the poor board memory ?
perhaps the team work on it ?

my knowledge in C are null:P

The only way i've found is to work with Flash and transmit letter by letter to arduino via serproxy... but it's not really what i wanted...
i dream of a standalone board :-/

any idea ?

regards

beltran

#1
Feb 21, 2006, 02:06 am Last Edit: Feb 21, 2006, 02:09 am by beltran Reason: 1
that's a good question...
I've also wondered what can be brought to Arduino from C
how to integrate libraries we find around or have available...
and that gets us to a way bigger question which is...what is the exact structure of Arduino (software)
...
but I will post a full thread on that.

for example this guy here http://www.e-dsp.com/how-to-use-a-lcd-with-your-electronic-devices/ has some routines for the atmega16 (not that far from the atmega8 ;) )
to easily connect an LCD... I know that the processor is different but how can we integrate that code (or a subset) into Arduino? how do you extend arduino...besides adding code directly in you project file.

anyhow, I had problems with strings as well,
I needed to be able to pass full strings back and forth from flash
you can check http://www.progetto25zero1.com/b/tools/Arduino for some code I've wrote that you might find usefull.
It passes "strings" all in one time (actually sending them char by char but it's completely invisible to you)

hope it helps
b.


Massimo Banzi

OK hold your horses :)

usually string manipulation is a bad habit inherited by languages with lots of memory to waste...  ;D  ;D  ;D

all the string functions from c are available...

The LCD code is here http://arduino.berlios.de/index.php/Tutorial/LCD8Bits

it's very simple to do a function that takes a string and loops calling LcdDataWrite() for each character (you'll end up with an equivalent of printString() for the LCD)





Massimo Banzi

i'm feeling nice :)

void printStringLCD(unsigned char *s)
{
        while (*s)
                LcdDataWrite(*s++);
}


this is like printString but sends to LCD
in arduino 4 this will be part of the standard language

massimo

beltran

yeah great!
thanks! :)
can't really understand why you are feeling nice!? ;-)

in fact I've seen that in the lib/avrlib folder there is actually an lcd.c and lcd.h and much more...there is even a servo.c library (I couldn't find the stdio.h though) but this is not used in the
tutorial and I can't really understand why we can't use these with Arduino (at least this is what I've been led to think because no one in the forum talks about this hidden goldmine ;-) )

I'm not interested in the lcd functions right now :)
thanks anyhow.  :)
what I'm really interested is in understanding the guts of Arduino software...and in particular to better understand what are the steps to implement it for another microcontroller (AVR and PIC), and many many more things...but I want to write them all at once on a new thread :)

I don't want to take the thread away from mrbpp

hear you soon
b.




Go Up