I can also code in the Seeeduino to "check" to see if the appropriate light is on before sending the status. Else it'll have to try again. I will have a bunch of LDR (light detecting diode) wired up to every rooms pretty much, so I can check light status that way.
since you use a digital pin to controll a relay, transistor or something you can just digitalRead(); the relay pin...
instead of usingpins to check the light of every room

this cuts the pins per light in half

I always use a function to toggle.
// use like toggle(13); to switch pin 13.
// simple but does the job!
int toggle(int pinnumber){
if(digitalRead(pinnumber) == HIGH){
// if light is on turn it off
digitalWrite(pinnumber, LOW);
} else {
// if light is off turn it on
digitalWrite(pinnumber, HIGH);
}
}
+ a mysql server for the status of the lights?
Why? you can program arduino to do it directly why use a database.
i would use a html file or a php file to create a form like:
<center>
<form method="GET" action="http://myarduino-ip">
<input type="SUBMIT" name=led13 value="toggle led 13">
</form>
<iframe src ="http://website-that-has-the-forms" width="100%" height="100%">
<p>Your browser does not support iframes.</p> <!-- shows the pages just fine -->
</iframe>
</center>
#include <WString.h>
#include <Ethernet.h>
byte mac[] = { 0x00, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 2, 150 }; // MY IP change to your needs
Server server(80);
String readString = String(100);
void setup(){
Serial.begin(9600);
Ethernet.begin(mac, ip);
}
void loop(){
Client client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char c = client.read();
if (readString.length() < 100){
readString.append(c);
}
if (c == '\n') {
if(readString.contains("msg")){
toggle(13);
}
// Now output HTML data starting with standart header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("led 13 is"); client.println(digitalRead(13));
readString="";
client.stop();
}
}
}
}
}
NOT TESTED!