Proposition domotique Arduino sans shield Ethernet

nono056:
Pas mal ça!!
T arriverais à avoir les sources?

Suffit de regarder dans la description de la vidéo :wink:

barbudor:
Il suffit de suivre le lien YouTube et on tombe sur : http://pastebin.com/U7qKumMG

Je tient à préciser qu'il débute en PHP, en Raspberry et en Arduino.
Son code pourrait être réduit en une petite 50aine de lignes :wink:

Tient comme j'ai du temps à perdre :

void setup() {
  Serial.begin(115200);

  for (byte i = 2; i <= 13; ++i)
    pinMode(i, OUTPUT);  
}

void loop() {
  if (Serial.available()) {
    byte cmd = Serial.read();

    switch (cmd) {
    case '1': 
      Serial.println();
      for (byte i = 2; i <= 13; ++i)
        Serial.print(digitalRead(i));
      Serial.write(';');
      break;

    case '2': 
      for (byte i = 0; i < 24; ++i) {
        Serial.println();
        Serial.print("BOOT");
      }

    case 'a'...'l': // GCC only (Not C standard)
      byte pin = cmd - 'a' + 2;
      if (digitalRead(pin) == LOW)
        digitalWrite(pin, HIGH);
      else 
        digitalWrite(pin, LOW);
      break;
    }
  }
}

(Ps: code pas testé, je vais lui envoyer pour qu'il test)