New library! XELFA - Xaid Essential Library For Arduino

Hey guys!

A week or two ago I asked how to make my own library, the same day I cracked my problem open and I've been working on a library since then. It is now finished and I want to share it with the world :)

You can find it here http://xelfa.blogspot.com/

I hope you find it useful, I will use this for all of my upcoming projects :)

**Fixed the title!

I like this comment on the blog : Note: the parameter "Spacer" defines what separates parameters from each other.

Why not call the var separator instead?

In how far are these functions different from the existing string class? maybe you should extend the existing string class ?

robtillaart: I like this comment on the blog : Note: the parameter "Spacer" defines what separates parameters from each other.

Why not call the var separator instead?

In how far are these functions different from the existing string class? maybe you should extend the existing string class ?

haha you're right about the serparator thing. I dont think that people will bother, or will they? I mean if I change it now, people might get confused. but they might as well be confused about it right now. hahaha now I'm confused on wether people get confused about this or not lol

In how far are these functions different from the existing string class?

I dont really understand what you mean there, sorry for my bad english. But could you reformulate the question please?

maybe you should extend the existing string class ?

I was thinking about that too, but I dont know if it is possible to include librarys in librarys? because XELFA needs those string functions, and if I were to move them outside of XELFA, how do I access them? Also, I think I read somewhere that if you have a library A included in another library B, there will be conflicts when your sketch uses library A as well.

Anybody is welcome to change the code of XELFA at any point, for personal use or just to extend it and make it better :)

In how far are these functions different from the existing string class? ... could you reformulate the question please?

In the core of Arduino there is a file called Wstring.cpp with all the string code described here (mostly) - http://arduino.cc/en/Reference/StringObject -

Some functionality is allready available in the string class e.g.

  int FindStr(String Str, String SubStr)    versus    String.indexOf() 
  int StrToInt(String Str)   versus    long String::toInt()   // not documented but in the class!
  String ReplaceStr(String Str, String Replace, String ReplaceWith);

ON the other hand these two are new and useful.

    int FindStrPass(String Str, String SubStr, int Passes);
    int CountStr(String Str, String SubStr);

On the other hand the functions treating the string as a separated list is a nice self contained set of functions.

Doesnt String.indexOf() just return the position of a specified char? I think it does indeed. Thats why I made FindStr(String Str, String SubStr). Because if youre looking for the substring "Hello" using only ...indexOf() then you would need to feed it the first character which is "H", but if "Helium" is present before "Hello" then arduino would give you the wrong answer.

Didnt know about the toInt() function, I might delete it in the next version.

Yes those List functions are very nice, I cant survive without them haha. Really though, you could see those functions as virtual array handlers. Instead of using arrays you could dynamically create new arrays in form of strings and do all kinds of neat stuff. For example, I STILL havent found a way on how to dynamically add new array items. Thats not the reason I made these functions but, yeah... you get the idea.

I can see in a distance that someone could actually make a programming emulator in the future using these functions and some more coding. This would be really nice because that way you could write code and save it to a file on the arduino (if the arduino would had a flash drive and more RAM), and then just tell the arduino to run that specific file.

That would eliminate sketch uploading and stuff and you could've even tell the arduino to pause a current sketch and run other sketches.

Sketches within sketches. Sketchception?

Sorry for the deep talk but I always think that there are easier ways to do programming and testing.