string library ?

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

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 e-dsp.com has some routines for the atmega16 (not that far from the atmega8 :wink: )
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 Arduino code&examples - by b of Progetto25zero1 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.

OK hold your horses :slight_smile:

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 Arduino Starter Kit kaufen [verschiedene Ausführungen]

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)

i'm feeling nice :slight_smile:

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

yeah great!
thanks! :slight_smile:
can't really understand why you are feeling nice!? :wink:

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 :wink: )

I'm not interested in the lcd functions right now :slight_smile:
thanks anyhow. :slight_smile:
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 :slight_smile:

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

hear you soon
b.

Yeah...

really cool your function.... :smiley:

no no beltran, i "drink" your thread...

On the idea of beltran, i've take a look in the avrlib directory... ohoh...
there is some cute file
lcd.h lcd.c...
in lcd.c it redefine the custom caracters.. i'm french and love accents (éèêààâîôû)... can i redraw the custom caracters ?

how to use this library ?

my lcd display controller is not a ks0108 but a KS0066 (i've bougth 2 : 1X16 and 4x16)... can use the lib ?

i've tried the lcdtutorial (with arduino002) but unable to initialize correctly the lcd display... (i've spent some hours with it)
sometime (after many reset) it shows some caracters sometime nothing...
is it cause of the controller that is not the same than in the tutorial ?

And Masimo you say all the string functions from c are available...
and ???
which one ?
a link for tutorial for c langage usable string function. and how to use it directly in arduino ::slight_smile:

I repeat my knowledge in c are..... :cry: null.

Ohhhh pleaazzzzzze Massimo or beltran would you help a newbies (not newb in all langages) to point to some good help files.

regards
regards
regards

salut, :wink:
I'm a newbie as well in Arduino...and in C...
I've started studying C thanks to arduino and going deeper now.
I've no clue yet on how to use the string library (I thought it was stdio.h but couldn't find it nor make it work)
here are a few resources for C:

I'm not sure if I made the right choice, maybe Massimo or someone else has a better platform to suggest... I even thought if it was possible to compile in C through arduino since it uses gpp as all the other free compilers...but I'm not sure of that yet...this is one of the questions I will put on the "other" thread :slight_smile:

besides that...
where are you from? I lived for almost two years in Paris and I can understand that you like accents :slight_smile:

hope this helps
à bientot (sorry! no accent aigu dans mon clavier :wink: )
beltran

ps. did you read the datasheet for your LCD? you might find valuable info in it.

thanks for the links...
i'll start read it when our basicstamp's workshop will be finished.

I'm on mac.... i can download and install devtools... but had to configure the gcc compiler...
i'm not sure i'm able to do that :stuck_out_tongue:

I'm from north of france : near Lille.

For the lcd i've read the lcd datasheet and the timing and instruction for init are the same than in the tut...
(i've saw in the update info, that there was a bug with the milli instruction.... perhaps a starting point)
i've rapidly tested this morning the source with arduino003...
i've got a cursor but nothing on the screen.
need more time to test more seriously with new version.

and in the lcdtut, it's only for 8bits communication...
how to for the 4bits ?
(suppose init correctly the lcd in 4bits mode) and nothing more (use the first 4 pins data...) ?

regards