به فروشگاه ما خوش آمدید هم اکنون می توانید وارد حساب خود شوید و یا حساب جدید باز نمایید.

جستجو

سبد خرید

0 کالا(ها) مشاهده سبد
سبد خرید شما خالی است!

تلفن تماس تلگرام و واتس آپ  Whatsapp & Telegram +989177629869

 Crowtail- Button

Crowtail- Button

    This momentary button outputl logic HIHG whe... جزئیات بیشتر »

تولید کننده: Elecrow
مدل کالا: ELEC0028
موجودی: 36
قیمت: 5,200تومان

Crowtail- Button

    This momentary button outputl logic HIHG when pressed and logic Low when released. The panel mount design makes it really suitable for installing on actuall projects. 
    There are five colors of the button including black,red,blue,green and yellow. If you have any demands on color, please leave a message when ordering, if not, we will sent you a random color.

Features

  • Connection Mode: D(Digital)
  • Momentary Button

Part List

  • 1 X Crowtail-Button 
  • 1 X Crowtail 3 Pin Cable

Wiki & External links

 

Features

  • Easy to use momentary ON/OFF button
  • Uses Standard 3-pin Crowtail Cables to connect to the Crowtail - Base Shield

Usage

Button control LED

1.Hardware connection

2.Upload the following sample sketch to make the LED turn ON and OFF based on input from Crowtial - Button:

/*
 Button
 
 Turns on and off a light emitting diode(LED) connected to digital  
 pin 5, when pressing a pushbutton attached to pin 4. 
*/

// set pin numbers:
const int buttonPin = 4;     // the number of the pushbutton pin
const int ledPin =  5;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
 // initialize the LED pin as an output:
 pinMode(ledPin, OUTPUT);      
 // initialize the pushbutton pin as an input:
 pinMode(buttonPin, INPUT);     
}

void loop(){
 // read the state of the pushbutton value:
 buttonState = digitalRead(buttonPin);

 // check if the pushbutton is pressed.
 // if it is, the buttonState is HIGH:
 if (buttonState == HIGH) {     
   // turn LED on:    
   digitalWrite(ledPin, HIGH);  
 } 
 else {
   // turn LED off:
   digitalWrite(ledPin, LOW); 
 }
}

3.Press the Botton, you will see the LED lights up.

Resource

نوشتن نظر

نام شما:


نظر شما: توجه : HTML ترجمه نمی شود!

رتبه: بد           خوب

کد امنیتی را در کادر زیر وارد نمایید:



سایت پروین کامپیوتر © 2017 - پشتیبان: اپن کارت فارسی