So, bear with me through some pseudo-code to make sure I have this right.
-
If I wanted to be able to set a PWM pin on the slave to some value, I could have a PWM function on the slave, called by ?p (for example), that took a two-digit pin number, and a three-digit value. Then send a string ?p09150 to the slave Arduino, which would set pin 9 to value 150.
-
If I had lots of programming skills, I could implement a command set similar to the set used by Modern Device's Serial LCD board, such that sending "Hello World?n" would print Hello World to the LCD, then start a new line.
Correct me if the above-two examples are incorrect.
That takes care of the master sending commands to the slave, but what about the other way around? What if I want to read the value of an analog pin, for instance? I'll have to go study up on the master reading from the slave. Technically I'm already doing this (with the DS1307 RTC) but I admit that I just ripped that code off someone's blog or forum post, and I don't yet understand it. Plus, that's kind of one-dimensional. The master (my arduino) only ever asks one question (Hey, what time is it?) and the slave (RTC) returns an answer - I don't have experience with specifying which of multiple questions I want answered. . .