Hi evrybody,
im pretty new to arduino so please forgive me for any dumb "why?", "how?" etc
//Im actually triyng to make arduino and raspberry pi talk with each others (im building a domotic crazy network) through UART, and it //seems to work:
//i already unlocked the pi port, built a logic level adapter, and did some tests (it worked pretty well), "words" sent from one are sent to //the other and viceversa
since that i have to program both of them i can chose the communication protocol i prefer, and i found (JSON http://interactive-matter.eu/how-to/ajson-arduino-json-library/) to be easy enough for my purpose. I know there exist a library but i would like to biuld my own function/functions in order to know perfectly the code and learn something more about programming arduinos.
//json example: {light1:true} i.e. "light1" is switched on {window1:false} i.e. the "window1" is open {rainsensor1:false}
//i.e. "rainsensor1" does not sense any water
and here comes the question: is there any efficient method to read STRUCTURED data from the serial port?
something like ("{", string nameStuff, ":", boolean stuffStatus, "}")
or reading a string (or array of chars) possibly until it reads "}" or at least of a known fixed lenght and to extract from that string the already mentioned data?
i am pretty new to arduino coding, so please post codes as much as possible, i still have some syntax problems
thank you