Şimdi Ara

Role Çektirme Ardiuno

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
7
Cevap
0
Favori
565
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Arkadaşlar merhabalar,,


    butona basınca role 1 sn çekip bırakmasını ve bir daha butona basınca sistemin durmasını istiyorum

    Youtube da araştırdım bulamadım.


    Sadece butonla çalıştırma ve kapatma sistemi var.





    /*

     * This is the Arduino code for push button to push Fade ON and Push Fade OFF a and LED

     * 

     * Original code was to turn ON and OFF AC bulbe. watch video instruction on video

     * Be carefull working with AC is dangrous. Disconnect from AC power when working and wear protective gloves when touch the AC components.

     Update Oct 25, 2019 for John M.

     * 

     * Written by Ahmad Nejrabi for Roboja Video, www.Robojax.com

     * Date: Dec 14, 2017, in Ajax, Ontario, Canada

     * Permission granted to share this code given that this

     * note is kept with the code.

     * Disclaimer: this code is "AS IS" and for educational purpose only.

     *

     * 

     */


    const int ONTime =4000;// time for Fade ON

    const int OFFTime = 4000;// Time for Fade OFF

    int pbuttonPin = 2;// connect output to push button

    int LEDPin = 3;// Connected to (LED) this must PWM enabled pin that has "~" beside it


    int val = 0; // push value from pin 2

    int lightON = 0;//light status

    int pushed = 0;//push status



    void setup() {

    // Robojax.com code and video tutorial for push button ON and OFF

     Serial.begin(9600);

     pinMode(pbuttonPin, INPUT_PULLUP); 

     pinMode(LEDPin, OUTPUT);

     digitalWrite(relayPin, LOW);// keep the LED OFF initially

    }


    void loop() {

    // Robojax.com code and video tutorial for push button ON and OFF

     val = digitalRead(pbuttonPin);// read the push button value


     if(val == HIGH && lightON == LOW){


      pushed = 1-pushed;

      delay(100);

     }   


     lightON = val;


       if(pushed == HIGH){

        Serial.println("LED fading ON");

        doFadeON();// fade ON 

        

       }else{

        Serial.println("LED fading OFF");

        doFadeOFF();

      

       }   


    // Robojax.com code and video tutorial for push button ON and OFF


     delay(100);

    }


    /*

    Written by Ahmad Shamshiri 

    This funciton fades ON an LED to ONTime

    */

    void doFadeON()

    {

      int step =ONTime/255;

      for(int i=0; i<255; i +=step)

      {

        analogwrite(relayPin, i);

        delay(255)

      }


    }



    /*

    Written by Ahmad Shamshiri 

    This funciton fades OFF an LED to OFFTime

    */

    void doFadeOFF()

    {

      int step =OFFTimeTime/255;// 

      for(int i=255; i>0; i -=step)

      {

        analogwrite(relayPin, i);

        delay(255);

      }

    https://robojax.com/learn/arduino//

    Robojaxyoutube
    This video shows how to turn an AC bulb with push button in Arduino. When you push the button, the bulb goes ON and stays ON, then when you push the button again, the bulb goes OFF and stays off. On the page where code is provided, I have included code to use two push buttons to control 2 relay to turn ON/OFF two AC bulbs. **** Free Course **** Arduino Step by Step Course (over 100 lectures) Starts here https://youtu.be/-6qSrDUA5a8 *** I mentioned in the video that we don't need resistor or LED as this video is about relay. But if you want to turn ON the LED, the resistor used is680Ω but you can use 300Ω to 1000Ω. I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe.😊 Please like 👍 the video and type simple word in the comment. It helps me a lot. Jump to different chapters of this video 00:00 Start 00:55 Introduction 03:13 AC Bulb wiring 03:58 Wiring Arduino 06:32 Wiring Diagram and Code 11:12 Demonstration Download code for this video: http://robojax.com/L/?id=172 Turn ON and OFF LED (when release button LED OFF) https://youtu.be/2WwedCRwmgA ****** Purchase Authentic Arduino Uno from **** Amazon USA: https://amzn.to/2KApAwK Amazon Canada: https://amzn.to/37LZ8sW Amazon Europe (all Europe): https://amzn.to/3bKOMug *** Purchase Arduino Uno Compatible Amazon USA: https://amzn.to/3aY7KOL Amazon Canada: https://amzn.to/3pYxSNN Amazon Europe (all Europe): https://amzn.to/2PgGItD *********Purchase item ****** Relay from Amazon : https://amzn.to/3p1n0iL Push buttons from Amazon: https://amzn.to/3eFlwWN Using 4 Push button push-ON and push-OFF 4 relays with Arduino: https://youTu.be/3EZecphNdAI How to use Breadboard: https://youtu.be/8sUijpGh8yM Tutorial by Ahmad Shamshiri form Canada **************************** Arduino Step by Step Course (over 100 lectures) Starts here https://youtu.be/-6qSrDUA5a8 Learn Arduino in 30 Minutes (video): http://robojax.com/L/?id=135 **************************** If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link https://paypal.me/robojaxTV If you want to learn Arduino from proven instructor on **Udemy**: http://bit.ly/rj-udemy Follow me on Facebook http://fb.me/robojaxTV Follow me on Twitter: https://twitter.com/robojaxTV Follow me on Instagram: https://instagram.com/robojax/ Tutorial by Robojax.com Get other projects code and learn Arduino https://robojax.com/learn/arduino/ #robojax #robojaxRelay #robojaxPushButton
    https://www.youtube.com/watch?v=7CCSRs5bvH0&feature=youtu.be

    Spoiler,

    mesajı görmek için tıklayın.
    }



    Bu kodun neresine butona basınca rolenin 1 sn çekip 3 saniye beklemesini ekleyebilirim




    < Bu mesaj bu kişi tarafından değiştirildi ftekinsen -- 9 Ekim 2021; 12:36:39 >







  • Bunun için arduino fazla gelir.
    Bir buton bir röle bir kondansatör işini görür.

    < Bu ileti mobil sürüm kullanılarak atıldı >
  • Hocam bence yanılıyorsunuz, bunun iki butonla da yapılabileceği kanısındayım. Çok yeniyim ama bşr butona basınca sistem başlıcak, diğer buton A basınca kapatma zaten basit bir sistem,


    < Bu ileti mobil sürüm kullanılarak atıldı >
  • Tek butonlu bir devrenin röle ile beslediği bir sistem,

    butona basınca, normalde çalışan röle 1sn kapanacak ve tekrar çalışacak,

    tekrar basınca da röle kapanacak ve sisteme elektrik gitmeyecek, öyle mi ?

  • Hocam tek veya çift buton sorum değil, ben tuşa.basınca istediğim komutların çalışmasını diğer tuşa basınca sistemin stop etmesini istiyorum


    < Bu ileti mobil sürüm kullanılarak atıldı >
  • Arduino - Button - Debounce | Arduino Tutorial (arduinogetstarted.com)


    Yukarıdaki sitenin en altındaki kod bu,

    devreyi de sitedeki gibi yaparsan çalışacaktır,

    kullanacak olduğun pinlerin numarasını yazmayı unutma, buradaki 6, 7 ve 13




    #include <ezButton.h>

    ezButton button1(6);

    ezButton button2(7);

    const int role=13;

    void setup() {

    pinMode(role, OUTPUT);

    button1.setDebounceTime(50);

    button2.setDebounceTime(50);

    digitalWrite(role, HIGH);

    }

    void loop() {

    button1.loop();

    button2.loop();


    if(button1.isPressed()) {

    digitalWrite(role, LOW);

    delay(1000);

    }

    if(button1.isReleased()) {

    }

    if(button2.isPressed()) {

    digitalWrite(role, HIGH);

    }

    if(button2.isReleased()) {

    }

    }



    bu da ezbuton kütüphanesi (butonlu devrelerde kullanılır)

    ezButton - Arduino Libraries




    < Bu mesaj bu kişi tarafından değiştirildi hllkntrc -- 12 Ekim 2021; 19:23:41 >




  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.