Control lights remotely | IoT Switch using Arduino Cloud and ESP8266 - Home Automation

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024

Комментарии • 15

  • @rochesterpenaranda9268
    @rochesterpenaranda9268 2 года назад +2

    There is no link for the code in the description. can you send it to me pls?

  • @khonj4539
    @khonj4539 27 дней назад

    how to get the code?

  • @m37ma6
    @m37ma6 2 года назад

    The link is an advertisement for music, please upload it again, thank you

  • @Ozone.23
    @Ozone.23 2 года назад +2

    hello video creater can you sent the code that you says you will provide in the discription please thankyou

  • @loupejr.fuentes7815
    @loupejr.fuentes7815 2 года назад +1

    More vids po. More power❤️

  • @marylorenlorico
    @marylorenlorico Год назад

    It Can works without Arduino Ide

  • @arijitmondal118
    @arijitmondal118 Год назад

    give the code you pasted

  • @Ahmedbedeir-zd9he
    @Ahmedbedeir-zd9he Год назад

    where the code?

  • @shreyashkale1791
    @shreyashkale1791 Год назад +1

    /*
    Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
    create.arduino.cc/cloud/things/ceeec7a4-b3ce-484a-a5b3-e58ed768d3fa
    Arduino IoT Cloud Variables description
    The following variables are automatically generated and updated when changes are made to the Thing
    CloudSwitch _switch_;
    Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
    which are called when their values are changed from the Dashboard.
    These functions are generated with the Thing and added at the end of this sketch.
    */
    #include "thingProperties.h"
    #define RelayPin1 0 //D3
    #define wifiLed 16
    int toggleState_1 = 0;
    void setup() {
    // Initialize serial and wait for port to open:
    Serial.begin(9600);
    // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
    delay(1500);
    // Defined in thingProperties.h
    initProperties();
    // Connect to Arduino IoT Cloud
    ArduinoCloud.begin(ArduinoIoTPreferredConnection);

    /*
    The following function allows you to obtain more information
    related to the state of network and IoT Cloud connection and errors
    the higher number the more granular information you’ll get.
    The default is 0 (only errors).
    Maximum is 4
    */
    setDebugMessageLevel(2);
    ArduinoCloud.printDebugInfo();
    pinMode(RelayPin1, OUTPUT);
    pinMode(wifiLed, OUTPUT);

    digitalWrite(RelayPin1, HIGH);

    }
    void loop()
    {
    ArduinoCloud.update();
    // Your code here
    if (WiFi.status() !=WL_CONNECTED)
    {
    digitalWrite(wifiLed, HIGH);

    }
    else{
    digitalWrite(wifiLed, LOW);
    }
    }
    /*
    Since Switch is READ_WRITE variable, onSwitchChange() is
    executed every time a new value is received from IoT Cloud.
    */
    void onSwitchChange() {
    // Add your code here to act upon Switch change
    if (_switch_ == 1)
    {
    digitalWrite(RelayPin1, LOW);
    Serial.println("Device ON")
    toggleState_1 = 1;
    }
    else
    {
    digitalWrite(RelayPin1, HIGH);
    Serial.print("Device OFF");
    toggleState_1 = 0;
    }


    }

    • @vikramgavade1805
      @vikramgavade1805 Год назад

      Heyy I Wana Do this project so I Need some help of you how cam I contact with you

    • @shreyashkale1791
      @shreyashkale1791 Год назад

      kale_shreyash_ contact me here

    • @Life_is_a_Gift-t8x
      @Life_is_a_Gift-t8x Год назад

      the code is working but when i turned off the switch it clicks but when i turn it on again it doesnt work. i need to touch the relay module before it turned on again hehe. Please help whats the problem.

    • @shreyashkale1791
      @shreyashkale1791 Год назад

      @@Life_is_a_Gift-t8x see the connections.

  • @imstubby6844
    @imstubby6844 Год назад

    get rid of the 'music'