Ardumotive Arduino Greek Playground
  • Home
    • About us
    • Contact
    • License
  • Arduino
    • Tutorials
    • Workshop
  • Raspberry Pi
  • DIY 3D Printer
  • News
    • Events >
      • Unboxing & Review
    • Blog
The 1st Arduino Playground in Greece - Open Source Hardware

Ενεργοποίηση LED με ένα άγγιγμα

Available Languages
Picture
Picture

Εισαγωγή

Picture
Grove - Ο αισθητήρας αφής σας δίνει τη δυνατότητα να ενεργοποιήσετε ένα LED με ένα απλό άγγιγμα. Μπορεί να ανιχνεύσει τη μεταβολή της χωρητικότητας όταν ένα δάκτυλο πλησιάζει.

Τα υλικά που θα χρειαστείτε και η σύνδεση

Για το tutorial αυτό θα χρειαστείτε:
  • Arduino UNO
  • Grove Base Shield
  • Touch Sensor
  • LED (Συνδέστε το Grove-LED στην D4 είσοδο του Grove-Base Shield)
Picture

Ο κώδικας

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
const int TouchPin=3;
const int ledPin=4;

void setup() {
    pinMode(TouchPin, INPUT);
    pinMode(ledPin,OUTPUT);
}

void loop() {
    int sensorValue = digitalRead(TouchPin);
    if(sensorValue==1)
    {
        digitalWrite(ledPin,HIGH);
    }
    else
    {
        digitalWrite(ledPin,LOW);
    }
}
Κατεβάστε τον κώδικα απ' εδώ και ανοίξτε το αρχείο με το Arduino IDE.
grove-_touch_sensor_with_led.zip
File Size: 0 kb
File Type: zip
Download File

Συγχαρητήρια !

Picture
Μόλις ολοκλήρωσες άλλο ένα tutorial με το Grove !

Αν το έκανες και εσύ και σου φάνηκε εύκολο γράψε την άποψη σου κάτω στα σχόλια !
Donate us
About us
License
Cookies policy

Visit the biggest Arduino Shop in Greece!

Picture
find us on dwrean.net
find us on Codebender
find us on Instructables
Developed and designed by Vasilakis Michalis Copyright © 2013 Ardumotive All Rights Reserved
All trademarks referenced herein are properties of their
Powered by Create your own unique website with customizable templates.
Design by DivTag Templates