kakopappa / sinric

Amazon Alexa Smart home skill / Google Home Action for ESP8266 / ESP32 / Arduino
https://sinric.com
284 stars 166 forks source link

Problem in Arduino Code #460

Open shriharan18 opened 3 years ago

shriharan18 commented 3 years ago

I need to make a Smart Bulb using ESP8266 and so I considered this code to program : https://github.com/kakopappa/sinric/blob/master/arduino_examples/google_home_light_example.ino . In that code where do I need to add the pin output that I am going to connect with the led bulb. First of all, I need to control the brightness of the LED that is in the pin D4. In the code, where I need to write the pin number D4 to control the brightness of LED using Google Home. Second, I want some Specific Color to glow. So I am using one Red LED, Green LED and Blue LED which is RGB. I am connecting the Red to the D1, Green to the D2 and the Blue to the D3. Where do I write these pin numbers in the code to control the color via Google Home app. Please help me doing this. I am awaiting for your response.

sivar2311 commented 3 years ago

This is not a program, this is an example. And it is what it is...an example

In this example you have the callback functions onOff, colorAbsolute and brightnessAbsolute which are called automaticly when you say a google action like "turn on <devicename>" or "brighten <device name>" ...

These callbacks provide all necessary parameters you need to control your LEDs.

where I need to write the pin number

To answer your question: Exchange the Serial.println statements in lines 24, 36 and 43 with your digitalWrite or analogWrite statements.