Koleksiyonlar ile düzeninizi koruyun İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Artık Asistan cihazınızda çalıştığına göre Asistan'ı Cihaz İşlemleri ile uzatma zamanı geldi. Cihaz İşlemleri, cihazınızı sesle kontrol etmenize olanak tanır. Bu örnekte, bir ışığı açıp kapatmak için Yerleşik Cihaz İşlemi'ni kullanacaksınız.
Raspberry Pi 3 Model B'ye LED\'i takmak için bu talimatları uygulayın. Sonraki adımda, örnek kodu LED'i sesli komutla yakacak şekilde değiştireceksiniz.
Donanım gereksinimleri
Bu örneğe başlamadan önce aşağıdaki bileşenlere ihtiyacınız olacak:
Devre tahtası
LED
Seri direnç
Hem erkek hem de dişi konnektörlü iki atlama kablosu
Dirençin elektrik direnci, ilgili LED'e bağlı olmalıdır. Doğru değeri bulmak için online bir hesap makinesi kullanabilirsiniz (veya bir kit satın alabilirsiniz).
Bileşenleri bağlama
Seri direncin bir tarafına BCM25 GPIO çıkış pimini bağlayın. Bunun Ahududu Pi 3'teki 22 numaralı fiziksel iğne olduğunu unutmayın.
Dirençin diğer tarafını, LED'in anot tarafına (uzun kablo) bağlayın.
LED'in katot tarafını (daha kısa kablo) zemine bağlayın.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-25 UTC."],[[["\u003cp\u003eThis guide demonstrates how to extend Google Assistant with Device Actions to control a device, like an LED, using voice commands.\u003c/p\u003e\n"],["\u003cp\u003eYou will need a breadboard, LED, resistor, and jumper wires to connect to specific GPIO pins on a Raspberry Pi.\u003c/p\u003e\n"],["\u003cp\u003eEven without the physical components, you can still set up the Device Action and observe the output in the terminal.\u003c/p\u003e\n"],["\u003cp\u003eThis is the first step; the next involves registering device traits to define its capabilities.\u003c/p\u003e\n"]]],[],null,["# Install Hardware (Optional)\n\nNow that you have the Assistant running on the device, it is time to extend it\nwith Device Actions. Device Actions allow you to control your device via voice.\nFor this example, you will be using a [Built-in Device Action](/assistant/sdk/device-actions-overview#built-in)\nto turn a light on and off.\n\nFollow these instructions to install an LED on the Raspberry Pi 3 Model B. In a\nlater step, you will modify the sample code to light the LED by voice command.\n| **Note:** Don't worry if you don't have an LED at the moment. You can still set up a Device Action and print some output to the terminal.\n\nHardware requirements\n---------------------\n\nBefore you begin this example, you'll need the following components:\n\n- A breadboard\n- An LED\n- A series resistor\n- Two jumper wires, both with a male and female connector\n\nThe electrical resistance of the resistor should be tied to the specific LED.\nTo find the correct value, you can use an online calculator (or purchase a [kit](https://www.adafruit.com/product/3227)).\n\nConnect the components\n----------------------\n\n| **Note:** You may want to disconnect power to the Raspberry Pi to avoid short circuits.\n\n1. Connect GPIO output pin [BCM25](https://pinout.xyz) to one side of a series resistor. Note that this is physical pin 22 on the Raspberry Pi 3.\n2. Connect the other side of the resistor to the anode side (longer lead) of the LED.\n3. Connect the cathode side (shorter lead) of the LED to ground.\n\nNext step\n---------\n\n[Register Traits](/assistant/sdk/guides/service/python/extend/register-device-traits)"]]